Skip to content

Commit e8a8f4d

Browse files
committed
Revert max_clause count from being volatile
Signed-off-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>
1 parent dd840fa commit e8a8f4d

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,6 @@ public class SearchService extends AbstractLifecycleComponent implements IndexEv
334334

335335
private volatile int maxOpenPitContext;
336336

337-
private volatile int maxClauseCount;
338-
339337
private volatile boolean allowDerivedField;
340338

341339
private final Cancellable keepAliveReaper;
@@ -410,8 +408,8 @@ public SearchService(
410408
lowLevelCancellation = LOW_LEVEL_CANCELLATION_SETTING.get(settings);
411409
clusterService.getClusterSettings().addSettingsUpdateConsumer(LOW_LEVEL_CANCELLATION_SETTING, this::setLowLevelCancellation);
412410

413-
setMaxClauseCount(INDICES_MAX_CLAUSE_COUNT_SETTING.get(settings));
414-
clusterService.getClusterSettings().addSettingsUpdateConsumer(INDICES_MAX_CLAUSE_COUNT_SETTING, this::setMaxClauseCount);
411+
IndexSearcher.setMaxClauseCount(INDICES_MAX_CLAUSE_COUNT_SETTING.get(settings));
412+
clusterService.getClusterSettings().addSettingsUpdateConsumer(INDICES_MAX_CLAUSE_COUNT_SETTING, IndexSearcher::setMaxClauseCount);
415413

416414
allowDerivedField = CLUSTER_ALLOW_DERIVED_FIELD_SETTING.get(settings);
417415
clusterService.getClusterSettings().addSettingsUpdateConsumer(CLUSTER_ALLOW_DERIVED_FIELD_SETTING, this::setAllowDerivedField);
@@ -495,11 +493,6 @@ private void setLowLevelCancellation(Boolean lowLevelCancellation) {
495493
this.lowLevelCancellation = lowLevelCancellation;
496494
}
497495

498-
private void setMaxClauseCount(int maxClauseCount) {
499-
this.maxClauseCount = maxClauseCount;
500-
IndexSearcher.setMaxClauseCount(maxClauseCount);
501-
}
502-
503496
@Override
504497
public void afterIndexRemoved(Index index, IndexSettings indexSettings, IndexRemovalReason reason) {
505498
// once an index is removed due to deletion or closing, we can just clean up all the pending search context information

0 commit comments

Comments
 (0)