Skip to content

Commit 1ddef54

Browse files
jed326Jay Deng
authored and
Jay Deng
committed
Disable concurrent segment search for system indices and throttled search requests
Signed-off-by: Jay Deng <jayd0104@gmail.com>
1 parent 6ddbdcd commit 1ddef54

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
107107
- Add a counter to node stat api to track shard going from idle to non-idle ([#12768](https://github.com/opensearch-project/OpenSearch/pull/12768))
108108
- Allow setting KEYSTORE_PASSWORD through env variable ([#12865](https://github.com/opensearch-project/OpenSearch/pull/12865))
109109
- [Concurrent Segment Search] Perform buildAggregation concurrently and support Composite Aggregations ([#12697](https://github.com/opensearch-project/OpenSearch/pull/12697))
110+
- [Concurrent Segment Search] Disable concurrent segment search for system indices and throttled requests ([#12697](https://github.com/opensearch-project/OpenSearch/pull/12697))
110111

111112
### Dependencies
112113
- Bump `org.apache.commons:commons-configuration2` from 2.10.0 to 2.10.1 ([#12896](https://github.com/opensearch-project/OpenSearch/pull/12896))

server/src/main/java/org/opensearch/search/DefaultSearchContext.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,11 @@ public boolean shouldUseConcurrentSearch() {
902902
* Evaluate if parsed request supports concurrent segment search
903903
*/
904904
public void evaluateRequestShouldUseConcurrentSearch() {
905-
if (sort != null && sort.isSortOnTimeSeriesField()) {
905+
// Do not use concurrent segment search for system indices or throttled requests. See:
906+
// https://github.com/opensearch-project/OpenSearch/issues/12951
907+
if (indexShard.isSystem() || indexShard.indexSettings().isSearchThrottled()) {
908+
requestShouldUseConcurrentSearch.set(false);
909+
} else if (sort != null && sort.isSortOnTimeSeriesField()) {
906910
requestShouldUseConcurrentSearch.set(false);
907911
} else if (aggregations() != null
908912
&& aggregations().factories() != null

0 commit comments

Comments
 (0)