Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-34865: [C++][Java][Flight RPC] Add Session management messages #34817

Merged
merged 195 commits into from
Feb 20, 2024

Conversation

indigophox
Copy link
Contributor

@indigophox indigophox commented Mar 31, 2023

Rationale for this change

Flight presently contains no formal mechanism for managing connection/query configuration options; instead, request headers and/or non-query SQL statements are often used in lieu, with unnecessary overhead and poor failure handling. A stateless (from Flight's perspective) Flight format extension is desirable to close this gap for server implementations that use/want connection state/context.

What changes are included in this PR?

"Session" set/get/close Actions and server-side helper middleware.

Are these changes tested?

Integration tests (C++ currently broken due to middleware-related framework issue) and some complex-case unit testing are included.

Are there any user-facing changes?

Non-breaking extensions to wire format and corresponding client/server Flight RPC API extensions.

@indigophox indigophox requested a review from lidavidm as a code owner March 31, 2023 02:55
@github-actions
Copy link

Thanks for opening a pull request!

If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

In the case of PARQUET issues on JIRA the title also supports:

PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

See also:

@kou
Copy link
Member

kou commented Mar 31, 2023

Could you open a new issue for this pull request? This is not a MINOR change:

Thanks for opening a pull request!

If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

In the case of PARQUET issues on JIRA the title also supports:

PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

See also:

* [Other pull requests](https://github.com/apache/arrow/pulls/)

* [Contribution Guidelines - How to contribute patches](https://arrow.apache.org/docs/developers/contributing.html#how-to-contribute-patches)

@lidavidm
Copy link
Member

I believe we discussed using headers as the base/fallback implementation; how does this integrate into that?

format/FlightSql.proto Outdated Show resolved Hide resolved
cpp/src/arrow/flight/sql/client.h Outdated Show resolved Hide resolved
format/FlightSql.proto Outdated Show resolved Hide resolved
format/FlightSql.proto Outdated Show resolved Hide resolved
cpp/src/arrow/flight/types.cc Outdated Show resolved Hide resolved
cpp/src/arrow/flight/types.h Outdated Show resolved Hide resolved
cpp/src/arrow/flight/sql/client.cc Outdated Show resolved Hide resolved
cpp/src/arrow/flight/sql/server.h Outdated Show resolved Hide resolved
cpp/src/arrow/flight/sql/server.cc Outdated Show resolved Hide resolved
cpp/src/arrow/flight/sql/server.cc Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Mar 31, 2023
@indigophox indigophox changed the title Add Session management messages, Location URI path accessors GH-34865: [C++][Flight RPC] Add Session management messages, Location URI path accessors Apr 3, 2023
@github-actions
Copy link

github-actions bot commented Apr 3, 2023

@github-actions
Copy link

github-actions bot commented Apr 3, 2023

⚠️ GitHub issue #34865 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions bot added awaiting change review Awaiting change review awaiting changes Awaiting changes and removed awaiting changes Awaiting changes awaiting change review Awaiting change review labels Apr 4, 2023
cpp/src/arrow/flight/types.h Outdated Show resolved Hide resolved
cpp/src/arrow/flight/types.cc Outdated Show resolved Hide resolved
cpp/src/arrow/flight/sql/types.h Outdated Show resolved Hide resolved
cpp/src/arrow/flight/sql/types.h Outdated Show resolved Hide resolved
cpp/src/arrow/flight/sql/types.h Outdated Show resolved Hide resolved
cpp/src/arrow/flight/sql/server.cc Outdated Show resolved Hide resolved
format/FlightSql.proto Outdated Show resolved Hide resolved
cpp/src/arrow/flight/sql/client.cc Outdated Show resolved Hide resolved
format/FlightSql.proto Outdated Show resolved Hide resolved
format/FlightSql.proto Outdated Show resolved Hide resolved
format/FlightSql.proto Outdated Show resolved Hide resolved
cpp/src/arrow/flight/sql/types.h Outdated Show resolved Hide resolved
cpp/src/arrow/flight/sql/server_session_middleware.h Outdated Show resolved Hide resolved
cpp/src/arrow/flight/sql/server_session_middleware.cc Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Jun 28, 2023
@indigophox indigophox changed the title GH-34865: [C++][Flight RPC] Add Session management messages, Location URI path accessors GH-34865: [C++][Flight RPC] Add Session management messages Jul 4, 2023
@github-actions github-actions bot removed the awaiting changes Awaiting changes label Jul 14, 2023
cpp/src/arrow/flight/integration_tests/test_integration.cc Outdated Show resolved Hide resolved
cpp/src/arrow/flight/integration_tests/test_integration.cc Outdated Show resolved Hide resolved
cpp/src/arrow/flight/integration_tests/test_integration.cc Outdated Show resolved Hide resolved

arrow::Result<CloseSessionResult> CloseSession(
const ServerCallContext& context, const CloseSessionRequest& request) override {
// Broken (does not expire cookie) until C++ middleware SendingHeaders handling fixed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still broken?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, pending #39791

Unfortunately nothing can be done about the issue here until the other fix is approved and merged.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Could you add the issue number to the comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, pending a push so I don't spam the CI bot too much.

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting merge Awaiting merge labels Feb 15, 2024
@indigophox indigophox force-pushed the flight-sql-session-management branch from 986b599 to f80b941 Compare February 15, 2024 21:07
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Feb 15, 2024
@indigophox
Copy link
Contributor Author

Could you update the PR description?

Could you rebase on main to fix R related CI jobs?

Done and done. Kept the more recently PR description sections and removed the old text above them.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the flightsql spec changes (not the C++/Java implementation) and I think they look well thought out and reasoned from my perspective.

We at InfluxData (primarily @kallisti-dev) are working on a concrete proposal for implementing prepared statements for stateless services -- #37720

While at first it might seem there is potential overlap with #37720 (e.g could we use cookies for #37720 or could this proposal encode session options in the handle), I believe since the session options target the entire connection rather than a specific statement, if makes sense to have two different mechanisms

So all in all this looks good to me. Thank you for your work @indigophox

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Feb 16, 2024
@lidavidm
Copy link
Member

I've closed the vote. I'll merge this now.

@lidavidm
Copy link
Member

AppVeyor is a timeout; the Java pipeline is a flake

@lidavidm lidavidm merged commit 2e2bd8b into apache:main Feb 20, 2024
41 of 43 checks passed
@lidavidm lidavidm removed the awaiting changes Awaiting changes label Feb 20, 2024
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 2e2bd8b.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them.

@kou
Copy link
Member

kou commented Feb 22, 2024

@github-actions crossbow submit java-jars

Copy link

Revision: 265e5e8

Submitted crossbow builds: ursacomputing/crossbow @ actions-0f25a8e0a3

Task Status
java-jars GitHub Actions

stevelorddremio pushed a commit to stevelorddremio/arrow that referenced this pull request Feb 26, 2024
…es (apache#34817)

### Rationale for this change

Flight presently contains no formal mechanism for managing connection/query configuration options; instead, request headers and/or non-query SQL statements are often used in lieu, with unnecessary overhead and poor failure handling.  A stateless (from Flight's perspective) Flight format extension is desirable to close this gap for server implementations that use/want connection state/context.

### What changes are included in this PR?

"Session" set/get/close Actions and server-side helper middleware.

### Are these changes tested?

Integration tests (C++ currently broken due to middleware-related framework issue) and some complex-case unit testing are included.

### Are there any user-facing changes?

Non-breaking extensions to wire format and corresponding client/server Flight RPC API extensions.

* Closes: apache#34865

Lead-authored-by: Paul Nienaber <paul.nienaber@dremio.com>
Co-authored-by: Paul Nienaber <github@phox.ca>
Co-authored-by: James Duong <jduong@dremio.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: David Li <li.davidm96@gmail.com>
# Conflicts:
#	java/flight/flight-integration-tests/src/main/java/org/apache/arrow/flight/integration/tests/Scenarios.java
#	java/flight/flight-integration-tests/src/test/java/org/apache/arrow/flight/integration/tests/IntegrationTest.java
#	testing
zanmato1984 pushed a commit to zanmato1984/arrow that referenced this pull request Feb 28, 2024
…es (apache#34817)

### Rationale for this change

Flight presently contains no formal mechanism for managing connection/query configuration options; instead, request headers and/or non-query SQL statements are often used in lieu, with unnecessary overhead and poor failure handling.  A stateless (from Flight's perspective) Flight format extension is desirable to close this gap for server implementations that use/want connection state/context.

### What changes are included in this PR?

"Session" set/get/close Actions and server-side helper middleware.

### Are these changes tested?

Integration tests (C++ currently broken due to middleware-related framework issue) and some complex-case unit testing are included.

### Are there any user-facing changes?

Non-breaking extensions to wire format and corresponding client/server Flight RPC API extensions.

* Closes: apache#34865

Lead-authored-by: Paul Nienaber <paul.nienaber@dremio.com>
Co-authored-by: Paul Nienaber <github@phox.ca>
Co-authored-by: James Duong <jduong@dremio.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: David Li <li.davidm96@gmail.com>
thisisnic pushed a commit to thisisnic/arrow that referenced this pull request Mar 8, 2024
…es (apache#34817)

### Rationale for this change

Flight presently contains no formal mechanism for managing connection/query configuration options; instead, request headers and/or non-query SQL statements are often used in lieu, with unnecessary overhead and poor failure handling.  A stateless (from Flight's perspective) Flight format extension is desirable to close this gap for server implementations that use/want connection state/context.

### What changes are included in this PR?

"Session" set/get/close Actions and server-side helper middleware.

### Are these changes tested?

Integration tests (C++ currently broken due to middleware-related framework issue) and some complex-case unit testing are included.

### Are there any user-facing changes?

Non-breaking extensions to wire format and corresponding client/server Flight RPC API extensions.

* Closes: apache#34865

Lead-authored-by: Paul Nienaber <paul.nienaber@dremio.com>
Co-authored-by: Paul Nienaber <github@phox.ca>
Co-authored-by: James Duong <jduong@dremio.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: David Li <li.davidm96@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[C++][FlightSQL] Add session management primitives
10 participants