Skip to content

Commit

Permalink
Revert max_clause count from being volatile
Browse files Browse the repository at this point in the history
Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
  • Loading branch information
harshavamsi committed Jun 13, 2024
1 parent dd840fa commit e8a8f4d
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions server/src/main/java/org/opensearch/search/SearchService.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,6 @@ public class SearchService extends AbstractLifecycleComponent implements IndexEv

private volatile int maxOpenPitContext;

private volatile int maxClauseCount;

private volatile boolean allowDerivedField;

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

setMaxClauseCount(INDICES_MAX_CLAUSE_COUNT_SETTING.get(settings));
clusterService.getClusterSettings().addSettingsUpdateConsumer(INDICES_MAX_CLAUSE_COUNT_SETTING, this::setMaxClauseCount);
IndexSearcher.setMaxClauseCount(INDICES_MAX_CLAUSE_COUNT_SETTING.get(settings));
clusterService.getClusterSettings().addSettingsUpdateConsumer(INDICES_MAX_CLAUSE_COUNT_SETTING, IndexSearcher::setMaxClauseCount);

allowDerivedField = CLUSTER_ALLOW_DERIVED_FIELD_SETTING.get(settings);
clusterService.getClusterSettings().addSettingsUpdateConsumer(CLUSTER_ALLOW_DERIVED_FIELD_SETTING, this::setAllowDerivedField);
Expand Down Expand Up @@ -495,11 +493,6 @@ private void setLowLevelCancellation(Boolean lowLevelCancellation) {
this.lowLevelCancellation = lowLevelCancellation;
}

private void setMaxClauseCount(int maxClauseCount) {
this.maxClauseCount = maxClauseCount;
IndexSearcher.setMaxClauseCount(maxClauseCount);
}

@Override
public void afterIndexRemoved(Index index, IndexSettings indexSettings, IndexRemovalReason reason) {
// once an index is removed due to deletion or closing, we can just clean up all the pending search context information
Expand Down

0 comments on commit e8a8f4d

Please sign in to comment.