Skip to content

Commit 19d1765

Browse files
authored
Merge branch 'main' into ktlo/esExecutorBug
2 parents 97fefa6 + 05c8453 commit 19d1765

File tree

37 files changed

+377
-405
lines changed

37 files changed

+377
-405
lines changed

docs/changelog/124313.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 124313
2+
summary: Optimize memory usage in `ShardBulkInferenceActionFilter`
3+
area: Search
4+
type: enhancement
5+
issues: []

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/cluster/ClusterModule.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public class ClusterModule extends AbstractModule {
107107

108108
public static final String BALANCED_ALLOCATOR = "balanced";
109109
public static final String DESIRED_BALANCE_ALLOCATOR = "desired_balance"; // default
110+
@UpdateForV10(owner = UpdateForV10.Owner.DISTRIBUTED_COORDINATION)
110111
public static final Setting<String> SHARDS_ALLOCATOR_TYPE_SETTING = Setting.simpleString(
111112
"cluster.routing.allocation.type",
112113
DESIRED_BALANCE_ALLOCATOR,

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,

0 commit comments

Comments
 (0)