Skip to content

Commit 05c8453

Browse files
authored
Remove search throttled index setting and thread pool (#124519)
Frozen indices, the freeze index API and the private index.frozen setting have been removed with #120539. There is also a search throttled thread pool that can now be removed, as well as a private search.throttled index settings that is no longer used as it could only be set internally by freezing an index. While the index setting is private and can be removed, as it should no longer be present in any index on 9.0+ indices, the thread pool settings associated to the removed pool are still accepted as no-op in case users have customized them and are upgrading without removing these. These will also trigger a deprecating warning. This change also removes the search.throttled related output from the thread pool section of the cluster info API.
1 parent f262839 commit 05c8453

File tree

19 files changed

+10
-146
lines changed

19 files changed

+10
-146
lines changed

rest-api-spec/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,5 @@ tasks.named("yamlRestCompatTestTransform").configure ({ task ->
8787
task.skipTest("indices.create/21_synthetic_source_stored/index param - field ordering", "Synthetic source keep arrays now stores leaf arrays natively")
8888
task.skipTest("indices.create/21_synthetic_source_stored/field param - keep nested array", "Synthetic source keep arrays now stores leaf arrays natively")
8989
task.skipTest("indices.create/21_synthetic_source_stored/field param - keep root array", "Synthetic source keep arrays now stores leaf arrays natively")
90+
task.skipTest("cluster.info/30_info_thread_pool/Cluster HTTP Info", "The search_throttled thread pool has been removed")
9091
})

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cluster.info/30_info_thread_pool.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,6 @@
9595
- gte: { thread_pool.search_coordination.largest: 0 }
9696
- gte: { thread_pool.search_coordination.completed: 0 }
9797

98-
- gte: { thread_pool.search_throttled.threads: 0 }
99-
- gte: { thread_pool.search_throttled.queue: 0 }
100-
- gte: { thread_pool.search_throttled.active: 0 }
101-
- gte: { thread_pool.search_throttled.rejected: 0 }
102-
- gte: { thread_pool.search_throttled.largest: 0 }
103-
- gte: { thread_pool.search_throttled.completed: 0 }
104-
10598
- gte: { thread_pool.snapshot.threads: 0 }
10699
- gte: { thread_pool.snapshot.queue: 0 }
107100
- gte: { thread_pool.snapshot.active: 0 }

server/src/main/java/org/elasticsearch/action/explain/TransportExplainAction.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646

4747
import java.io.IOException;
4848
import java.util.Set;
49-
import java.util.concurrent.Executor;
5049
import java.util.function.LongSupplier;
5150

5251
/**
@@ -184,12 +183,4 @@ protected ShardIterator shards(ProjectState state, InternalRequest request) {
184183
return clusterService.operationRouting()
185184
.getShards(state, request.concreteIndex(), request.request().id(), request.request().routing(), request.request().preference());
186185
}
187-
188-
@Override
189-
protected Executor getExecutor(ExplainRequest request, ShardId shardId) {
190-
IndexService indexService = searchService.getIndicesService().indexServiceSafe(shardId.getIndex());
191-
return indexService.getIndexSettings().isSearchThrottled()
192-
? threadPool.executor(ThreadPool.Names.SEARCH_THROTTLED)
193-
: super.getExecutor(request, shardId);
194-
}
195186
}

server/src/main/java/org/elasticsearch/action/get/TransportGetAction.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ protected Executor getExecutor(GetRequest request, ShardId shardId) {
171171
final ClusterState clusterState = clusterService.state();
172172
if (projectResolver.getProjectMetadata(clusterState).getIndexSafe(shardId.getIndex()).isSystem()) {
173173
return threadPool.executor(executorSelector.executorForGet(shardId.getIndexName()));
174-
} else if (indicesService.indexServiceSafe(shardId.getIndex()).getIndexSettings().isSearchThrottled()) {
175-
return threadPool.executor(ThreadPool.Names.SEARCH_THROTTLED);
176174
} else {
177175
return super.getExecutor(request, shardId);
178176
}

server/src/main/java/org/elasticsearch/action/get/TransportShardMultiGetAction.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,6 @@ protected Executor getExecutor(MultiGetShardRequest request, ShardId shardId) {
160160
final ClusterState clusterState = clusterService.state();
161161
if (projectResolver.getProjectMetadata(clusterState).index(shardId.getIndex()).isSystem()) {
162162
return threadPool.executor(executorSelector.executorForGet(shardId.getIndexName()));
163-
} else if (indicesService.indexServiceSafe(shardId.getIndex()).getIndexSettings().isSearchThrottled()) {
164-
return threadPool.executor(ThreadPool.Names.SEARCH_THROTTLED);
165163
} else {
166164
return super.getExecutor(request, shardId);
167165
}

server/src/main/java/org/elasticsearch/action/termvectors/TransportShardMultiTermsVectorAction.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
import org.elasticsearch.threadpool.ThreadPool;
2929
import org.elasticsearch.transport.TransportService;
3030

31-
import java.util.concurrent.Executor;
32-
3331
import static org.elasticsearch.core.Strings.format;
3432

3533
public class TransportShardMultiTermsVectorAction extends TransportSingleShardAction<
@@ -112,12 +110,4 @@ protected MultiTermVectorsShardResponse shardOperation(MultiTermVectorsShardRequ
112110

113111
return response;
114112
}
115-
116-
@Override
117-
protected Executor getExecutor(MultiTermVectorsShardRequest request, ShardId shardId) {
118-
IndexService indexService = indicesService.indexServiceSafe(shardId.getIndex());
119-
return indexService.getIndexSettings().isSearchThrottled()
120-
? threadPool.executor(ThreadPool.Names.SEARCH_THROTTLED)
121-
: super.getExecutor(request, shardId);
122-
}
123113
}

server/src/main/java/org/elasticsearch/action/termvectors/TransportTermVectorsAction.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.elasticsearch.transport.TransportService;
2929

3030
import java.io.IOException;
31-
import java.util.concurrent.Executor;
3231

3332
/**
3433
* Performs the get operation.
@@ -127,12 +126,4 @@ protected TermVectorsResponse shardOperation(TermVectorsRequest request, ShardId
127126
protected Writeable.Reader<TermVectorsResponse> getResponseReader() {
128127
return TermVectorsResponse::new;
129128
}
130-
131-
@Override
132-
protected Executor getExecutor(TermVectorsRequest request, ShardId shardId) {
133-
IndexService indexService = indicesService.indexServiceSafe(shardId.getIndex());
134-
return indexService.getIndexSettings().isSearchThrottled()
135-
? threadPool.executor(ThreadPool.Names.SEARCH_THROTTLED)
136-
: super.getExecutor(request, shardId);
137-
}
138129
}

server/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
157157
IndexSettings.INDEX_TRANSLOG_RETENTION_AGE_SETTING,
158158
IndexSettings.INDEX_TRANSLOG_RETENTION_SIZE_SETTING,
159159
IndexSettings.INDEX_SEARCH_IDLE_AFTER,
160-
IndexSettings.INDEX_SEARCH_THROTTLED,
161160
IndexFieldDataService.INDEX_FIELDDATA_CACHE_KEY,
162161
IndexSettings.IGNORE_ABOVE_SETTING,
163162
FieldMapper.IGNORE_MALFORMED_SETTING,

server/src/main/java/org/elasticsearch/index/IndexSettings.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -538,17 +538,6 @@ public Iterator<Setting<?>> settings() {
538538
Property.ServerlessPublic
539539
);
540540

541-
/**
542-
* Marks an index to be searched throttled. This means that never more than one shard of such an index will be searched concurrently
543-
*/
544-
public static final Setting<Boolean> INDEX_SEARCH_THROTTLED = Setting.boolSetting(
545-
"index.search.throttled",
546-
false,
547-
Property.IndexScope,
548-
Property.PrivateIndex,
549-
Property.Dynamic
550-
);
551-
552541
/**
553542
* Determines a balance between file-based and operations-based peer recoveries. The number of operations that will be used in an
554543
* operations-based peer recovery is limited to this proportion of the total number of documents in the shard (including deleted
@@ -913,7 +902,6 @@ private void setRetentionLeaseMillis(final TimeValue retentionLease) {
913902
private volatile int maxTermsCount;
914903
private volatile String defaultPipeline;
915904
private volatile String requiredPipeline;
916-
private volatile boolean searchThrottled;
917905
private volatile long mappingNestedFieldsLimit;
918906
private volatile long mappingNestedDocsLimit;
919907
private volatile long mappingTotalFieldsLimit;
@@ -1042,7 +1030,6 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
10421030
this.timestampBounds = TimestampBounds.updateEndTime(this.timestampBounds, endTime);
10431031
});
10441032
}
1045-
this.searchThrottled = INDEX_SEARCH_THROTTLED.get(settings);
10461033
this.queryStringLenient = QUERY_STRING_LENIENT_SETTING.get(settings);
10471034
this.queryStringAnalyzeWildcard = QUERY_STRING_ANALYZE_WILDCARD.get(nodeSettings);
10481035
this.queryStringAllowLeadingWildcard = QUERY_STRING_ALLOW_LEADING_WILDCARD.get(nodeSettings);
@@ -1200,7 +1187,6 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
12001187
scopedSettings.addSettingsUpdateConsumer(DEFAULT_PIPELINE, this::setDefaultPipeline);
12011188
scopedSettings.addSettingsUpdateConsumer(FINAL_PIPELINE, this::setRequiredPipeline);
12021189
scopedSettings.addSettingsUpdateConsumer(INDEX_SOFT_DELETES_RETENTION_OPERATIONS_SETTING, this::setSoftDeleteRetentionOperations);
1203-
scopedSettings.addSettingsUpdateConsumer(INDEX_SEARCH_THROTTLED, this::setSearchThrottled);
12041190
scopedSettings.addSettingsUpdateConsumer(INDEX_SOFT_DELETES_RETENTION_LEASE_PERIOD_SETTING, this::setRetentionLeaseMillis);
12051191
scopedSettings.addSettingsUpdateConsumer(INDEX_MAPPING_NESTED_FIELDS_LIMIT_SETTING, this::setMappingNestedFieldsLimit);
12061192
scopedSettings.addSettingsUpdateConsumer(INDEX_MAPPING_NESTED_DOCS_LIMIT_SETTING, this::setMappingNestedDocsLimit);
@@ -1725,18 +1711,6 @@ public long getSoftDeleteRetentionOperations() {
17251711
return this.softDeleteRetentionOperations;
17261712
}
17271713

1728-
/**
1729-
* Returns true if the this index should be searched throttled ie. using the
1730-
* {@link org.elasticsearch.threadpool.ThreadPool.Names#SEARCH_THROTTLED} thread-pool
1731-
*/
1732-
public boolean isSearchThrottled() {
1733-
return searchThrottled;
1734-
}
1735-
1736-
private void setSearchThrottled(boolean searchThrottled) {
1737-
this.searchThrottled = searchThrottled;
1738-
}
1739-
17401714
public long getMappingNestedFieldsLimit() {
17411715
return mappingNestedFieldsLimit;
17421716
}

server/src/main/java/org/elasticsearch/node/NodeConstruction.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,14 @@ private static void addBwcSearchWorkerSettings(List<Setting<?>> additionalSettin
570570
additionalSettings.add(
571571
Setting.intSetting("thread_pool.search_worker.size", 0, Setting.Property.NodeScope, Setting.Property.DeprecatedWarning)
572572
);
573+
// Search throttled thread pool has been removed in Elasticsearch 9.0.0. These settings are deprecated and take no effect.
574+
// They are here only to enable BwC for deployments that still use them
575+
additionalSettings.add(
576+
Setting.intSetting("thread_pool.search_throttled.queue_size", 0, Setting.Property.NodeScope, Setting.Property.DeprecatedWarning)
577+
);
578+
additionalSettings.add(
579+
Setting.intSetting("thread_pool.search_throttled.size", 0, Setting.Property.NodeScope, Setting.Property.DeprecatedWarning)
580+
);
573581
}
574582

575583
private SearchModule createSearchModule(Settings settings, ThreadPool threadPool, TelemetryProvider telemetryProvider) {

0 commit comments

Comments
 (0)