-
Notifications
You must be signed in to change notification settings - Fork 156
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
Fix query ui history redirect #193
base: master
Are you sure you want to change the base?
Conversation
ae80dfe
to
49dced5
Compare
String routingGroup = routingGroupSelector.findRoutingGroup(request); | ||
String user = Optional.ofNullable(request.getHeader(USER_HEADER)) | ||
.orElse(request.getHeader(ALTERNATE_USER_HEADER)); | ||
if (!Strings.isNullOrEmpty(routingGroup)) { | ||
// This falls back on adhoc backend if there are no cluster found for the routing group. | ||
backendAddress = routingManager.provideBackendForRoutingGroup(routingGroup, user); | ||
return routingManager.provideBackendForRoutingGroup(routingGroup, user); |
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.
please dont return from here. Below lines are skipped. without this, subsequent calls would require a broadcast to all backends for query id lookup.
// set target backend so that we could save queryId to backend mapping later.
((MultiReadHttpServletRequest) request).addHeader(PROXY_TARGET_HEADER, backendAddress);
would be nice if you could add a test case validating the presence of this header in the response.
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.
Hi @puneetjaiswal thanks for taking a look. The above return
is within the orElseGet
lambda for the backendAddress
assignment. Effectively, L137 doesn't get skipped. I'll add a test.
@regadas heads up, this fails
|
@Pluies yup indeed it was faulty, somehow I missed that. Thanks for pointing that out! |
Hi, it would be great if this PR gets merged ! |
Hello!
This addresses the issue in #162 here
/ui/query?<QUERYID>
is redirected by default to adhoc