-
Notifications
You must be signed in to change notification settings - Fork 80
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
Add destination cluster info to response cookie #466
Add destination cluster info to response cookie #466
Conversation
gateway-ha/src/main/java/io/trino/gateway/ha/config/HaGatewayConfiguration.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/ha/config/HaGatewayConfiguration.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/ha/config/HaGatewayConfiguration.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/proxyserver/ProxyRequestHandler.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/proxyserver/ProxyRequestHandler.java
Outdated
Show resolved
Hide resolved
I think a Cookie would be more appropriate than adding a new header. Typically headers implement the protocol, and cookies are used for storing session information and passing data back and forth |
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
@harishnelakurthi please sign the CLA so that we can take this forward, and address all comments. Please squash your commits as well. |
@willmostly - I have signed the CLA and emailed a week ago. Also, I've addressed all the comments on the PR except there was an open question which I have responded to the reviewer. Let me know if anything is needed from my end. |
@harishnelakurthi I think you may have missed my comment above. I would like to avoid adding a new header just to pass back information unrelated to the routing protocol. This should be a cookie. You can also update the logic such that the cookie is only added/updated in the response to a POST to |
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Thanks, @willmostly I have made the changes to pass this data via session cookie. Please review and let me know if any changes are needed. Also, updated the PR title and description. Will squash the commits before merge. |
Can we change the PR name and commit title to "cluster" instead of "backend" |
@harishnelakurthi you can use Airlift's codestyle in your IDE to avoid builds failing due to checkstyle https://github.com/airlift/codestyle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty close % comments.
Can you add a test for this functionality? TestGatewayHaMultipleBackend
should have the infrastructure you need
gateway-ha/src/main/java/io/trino/gateway/proxyserver/ProxyRequestHandler.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/proxyserver/ProxyRequestHandler.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor code comments and some additional testing
gateway-ha/src/main/java/io/trino/gateway/proxyserver/ProxyRequestHandler.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/proxyserver/ProxyRequestHandler.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ready. Please remove the stray newline from the testQueryDeliveryToMultipleRoutingGroups
method and we can get this merged
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/ha/config/HaGatewayConfiguration.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/ha/config/HaGatewayConfiguration.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/proxyserver/ProxyRequestHandler.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/proxyserver/ProxyRequestHandler.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
Please squash commits into one. |
gateway-ha/src/main/java/io/trino/gateway/proxyserver/ProxyRequestHandler.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
@ebyhr @willmostly Addressed all the comments.If there are no comments I can squash all the commits and would appreciate merging this in as it's been hanging around for a while. |
4d523b3
to
1088ef7
Compare
This comment was marked as resolved.
This comment was marked as resolved.
86d573f
to
724f2e8
Compare
@ebyhr - I've addressed all the comments on this. Can this be merged please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good except for comments.
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/TestGatewayHaMultipleBackend.java
Outdated
Show resolved
Hide resolved
@harishnelakurthi Please squash commits into one. |
9a02d1d
to
6ed62bc
Compare
Thanks a lot @ebyhr for all the comments. I've squashed all the commits. Can you merge the PR if it's all good? Let me know if anything else needs to be done. Thanks! |
This comment was marked as resolved.
This comment was marked as resolved.
6ed62bc
to
e528dbf
Compare
Description
Add destination cluster a query is routed to in the cookie. More details here of the use-case here: #465
Fixes #465
Release notes