-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Increase step between checks for cancellation #53712
Conversation
Check for cancellation every 1024 docs instead of every 15 to lower the impact of the check in query's performance. Fixes: elastic#53496
Pinging @elastic/es-search (:Search/Search) |
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 left one comment that needs to be addressed
@@ -245,7 +245,7 @@ public int getDocCount() { | |||
|
|||
private static class ExitableIntersectVisitor implements PointValues.IntersectVisitor { | |||
|
|||
private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = (1 << 4) - 1; // 15 | |||
private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = 1 << 10; // 1024 |
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.
private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = 1 << 10; // 1024 | |
private static final int MAX_CALLS_BEFORE_QUERY_TIMEOUT_CHECK = (1 << 10) - 1; // 1023 |
Benchmark results showing the effect of the change:
|
Here are the results between the status before the ExitableDirectoryReader and after but with the change to check every 1023 docs instead of every 15:
FYI @jimczi |
The introduction of the ExitableDirectoryReader showed increase of
latencies for range queries using pointvalues.
Check for cancellation every 1024 docs instead of every 15 to lower
the impact of the check in query's performance.
Follows: #52822
Fixes: #53496