-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Ask server to directly return final result for queries hitting single server #11938
Ask server to directly return final result for queries hitting single server #11938
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11938 +/- ##
============================================
- Coverage 61.42% 61.40% -0.03%
+ Complexity 1147 1141 -6
============================================
Files 2378 2378
Lines 128894 128924 +30
Branches 19929 19939 +10
============================================
- Hits 79177 79165 -12
- Misses 44001 44041 +40
- Partials 5716 5718 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 9 files with indirect coverage changes 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
e4fa9bf
to
8012442
Compare
// Set the query option to directly return final result for single server query unless it is explicitly disabled | ||
if (numServers == 1) { | ||
if (queryOptions.putIfAbsent(QueryOptionKey.SERVER_RETURN_FINAL_RESULT, "true") == null | ||
&& offlineBrokerRequest != serverBrokerRequest) { |
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.
realtimeBrokerRequest?
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.
Good catch! Let me also add some comment explaining this
8012442
to
542128d
Compare
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.
lgtm
#9304 introduced the query option
serverReturnFinalResult
which can be used when no broker reduce is required, and ask server to directly return the final aggregation result.This PR extends that by automatically applying this query option when only one server is queried.
This PR also contains some bug fixes: