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

Have the presto jdbc driver handle set-cookie responses that may come from load balancers. #9343

Closed
alee-r7 opened this issue Nov 14, 2017 · 4 comments

Comments

@alee-r7
Copy link

alee-r7 commented Nov 14, 2017

We've been wanting to run more than 1 presto cluster behind an ELB and have our applications use the Presto JDBC driver to issues queries against. Unfortunately it doesn't work since a single request is composed of multiple http requests and those requests will be distributed to each cluster.

What would be nice is if we can take advantage of AWS ELB's stick session policy. This would require the Cookie header to be set. But with the JDBC driver you can't set it. If I could set any type of custom or fixed cookie header in my request, then my application could generate unique id for that request before sending out the request.

@alee-r7
Copy link
Author

alee-r7 commented Jan 11, 2018

Actually this approach is wrong. In order for this to work the driver will need to look for Set-cookie responses and resent those cookies in the follow up requests after the initial. This way you can use the ELB generated session cookies vs. having Presto define it. I've gotten it to work by reimplementing the StatementClient in the JDBC driver to look for the Set-Cookie response for the AWS ELB. Then resending it works.

I would suggest to allow the presto JDBC driver to handle set-cookie responses as an option and custom configure which cookie value they to resend.

@alee-r7 alee-r7 changed the title Allow http custom headers or cookie header to be set in the presto jdbc driver Have the presto jdbc driver handle set-cookie responses that may come from load balancers. Jan 11, 2018
@findepi
Copy link
Contributor

findepi commented Jan 11, 2018

@alee-r7 , did you see #9684 ?

@alee-r7
Copy link
Author

alee-r7 commented Jan 11, 2018

No I haven't but looks like that should work if it supports cookies. I guess I'll wait until it gets merged into master and then AWS upgrades their version of Presto.

@findepi
Copy link
Contributor

findepi commented May 16, 2018

#9684 is merged, closing this.

@findepi findepi closed this as completed May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants