-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Disable concurrent search for terminate_after path #10200
Conversation
Compatibility status:Checks if related components are compatible with change e69448e Incompatible componentsSkipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/neural-search.git] |
Gradle Check (Jenkins) Run Completed with:
|
672e8aa
to
d2bf2f5
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
d2bf2f5
to
1dd3eed
Compare
ad70a60
to
a868a53
Compare
Gradle Check (Jenkins) Run Completed with:
|
a868a53
to
e147b67
Compare
Gradle Check (Jenkins) Run Completed with:
|
@reta @sohami could you help review this? I ended up just disabling concurrent search for |
Signed-off-by: Jay Deng <[email protected]>
e147b67
to
e69448e
Compare
server/src/internalClusterTest/java/org/opensearch/search/simple/SimpleSearchIT.java
Show resolved
Hide resolved
Gradle Check (Jenkins) Run Completed with:
|
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.
This is fine for now, but lets update the original issue with all the open items related information so that it is available when we pick up next time.
Signed-off-by: Jay Deng <[email protected]> (cherry picked from commit 3a790c1) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…oject#10200) Signed-off-by: Jay Deng <[email protected]>
(cherry picked from commit 3a790c1) Signed-off-by: Jay Deng <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…oject#10200) Signed-off-by: Jay Deng <[email protected]>
…oject#10200) Signed-off-by: Jay Deng <[email protected]>
@@ -896,6 +896,8 @@ public void evaluateRequestShouldUseConcurrentSearch() { | |||
&& aggregations().factories() != null | |||
&& !aggregations().factories().allFactoriesSupportConcurrentSearch()) { | |||
requestShouldUseConcurrentSearch.set(false); | |||
} else if (terminateAfter != DEFAULT_TERMINATE_AFTER) { | |||
requestShouldUseConcurrentSearch.set(false); |
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.
If we disable concurrent search here, while there is a timeout in effect, this can have the effect of causing a significant reduction in total documents scanned across all nodes. That means you would get different results.
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.
If we disable concurrent search here, while there is a timeout in effect,
I am not sure I understand the issue, but this is how aggregations work right now (they are sequential, not concurrent). The concurrent path have some limitation related to timeouts though, that is correct
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'm also not sure I understand the issue, specifically what "That means you would get different results" is referring to. What is happening here is that we are reverting back to the non-concurrent search workflow whenever the terminate_after
search parameter is used.
Here is a (very long) issue with more details on the problems surrounding terminate_after
, force termination, and concurrent search: #8371
…oject#10200) Signed-off-by: Jay Deng <[email protected]> Signed-off-by: Shivansh Arora <[email protected]>
Disable concurrent search when
terminate_after
parameter is used.Originally I planned on having this PR include a
terminate_after
threshold settings for values below which concurrent search would be disabled. However, I ran into a problem inTotalHitCountCollector::reduce
that makes it difficult to get the correctTotalHits.relation
.OpenSearch/server/src/main/java/org/opensearch/search/query/TotalHitCountCollectorManager.java
Lines 72 to 91 in bab2e59
The problem is the
TotalHitCountCollectorManager
only hasterminatedAfter
value and thetotalHits
values but that is not enough to determine what the relation should be. Based on the limited amount of time I spent looking into this so far, this looks like a pretty heavy duty refactor needs to be done here so I think the whole "forceTermination + terminate_after threshold portion" can be taken as a future perf improvement instead.Related Issues
Resolves #8371
Resolves #9946
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.