Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use search_coordination threadpool in field caps #79399

Merged
merged 1 commit into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public TransportFieldCapabilitiesAction(TransportService transportService,
final Set<String> metadataFields = indicesService.getAllMetadataFields();
this.metadataFieldPred = metadataFields::contains;

transportService.registerRequestHandler(ACTION_NODE_NAME, ThreadPool.Names.MANAGEMENT,
transportService.registerRequestHandler(ACTION_NODE_NAME, ThreadPool.Names.SEARCH_COORDINATION,
FieldCapabilitiesNodeRequest::new, new NodeTransportHandler());
transportService.registerRequestHandler(ACTION_SHARD_NAME, ThreadPool.Names.SAME,
FieldCapabilitiesIndexRequest::new, new ShardTransportHandler());
Expand Down Expand Up @@ -117,7 +117,7 @@ protected void doExecute(Task task, FieldCapabilitiesRequest request, final Acti
localIndices,
nowInMillis,
concreteIndices,
threadPool.executor(ThreadPool.Names.MANAGEMENT),
threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION),
indexResponse -> indexResponses.putIfAbsent(indexResponse.getIndexName(), indexResponse),
indexFailures::collect,
countDown
Expand Down Expand Up @@ -167,9 +167,9 @@ private Runnable createResponseMerger(FieldCapabilitiesRequest request,
List<FieldCapabilitiesFailure> failures = indexFailures.build(indexResponses.keySet());
if (indexResponses.size() > 0) {
if (request.isMergeResults()) {
// fork off to the management pool for merging the responses as the operation can run for longer than is acceptable
// on a transport thread in case of large numbers of indices and/or fields
threadPool.executor(ThreadPool.Names.MANAGEMENT).submit(
// fork off to the search_coordination threadpool for merging the responses as the operation can run for longer
// than is acceptable on a transport thread in case of large numbers of indices and/or fields
threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION).submit(
ActionRunnable.supply(
listener,
() -> merge(indexResponses, request.includeUnmapped(), new ArrayList<>(failures)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void testHappyCluster() throws Exception {
OriginalIndices.NONE,
randomNonNegativeLong(),
indices.toArray(new String[0]),
transportService.threadPool.executor(ThreadPool.Names.MANAGEMENT),
transportService.threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION),
responseCollector::addIndexResponse,
responseCollector::addIndexFailure,
responseCollector::onComplete);
Expand Down Expand Up @@ -211,7 +211,7 @@ public void testRetryThenOk() throws Exception {
OriginalIndices.NONE,
randomNonNegativeLong(),
indices.toArray(new String[0]),
transportService.threadPool.executor(ThreadPool.Names.MANAGEMENT),
transportService.threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION),
responseCollector::addIndexResponse,
responseCollector::addIndexFailure,
responseCollector::onComplete
Expand Down Expand Up @@ -347,7 +347,7 @@ public void testRetryButFails() throws Exception {
OriginalIndices.NONE,
randomNonNegativeLong(),
indices.toArray(new String[0]),
transportService.threadPool.executor(ThreadPool.Names.MANAGEMENT),
transportService.threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION),
responseCollector::addIndexResponse,
responseCollector::addIndexFailure,
responseCollector::onComplete);
Expand Down Expand Up @@ -489,7 +489,7 @@ public void testSuccessWithAnyMatch() throws Exception {
OriginalIndices.NONE,
randomNonNegativeLong(),
indices.toArray(new String[0]),
transportService.threadPool.executor(ThreadPool.Names.MANAGEMENT),
transportService.threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION),
responseCollector::addIndexResponse,
responseCollector::addIndexFailure,
responseCollector::onComplete);
Expand Down Expand Up @@ -598,7 +598,7 @@ public void testStopAfterAllShardsUnmatched() throws Exception {
OriginalIndices.NONE,
randomNonNegativeLong(),
indices.toArray(new String[0]),
transportService.threadPool.executor(ThreadPool.Names.MANAGEMENT),
transportService.threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION),
responseCollector::addIndexResponse,
responseCollector::addIndexFailure,
responseCollector::onComplete
Expand Down Expand Up @@ -895,7 +895,7 @@ protected void doClose() throws IOException {

@SuppressWarnings("unchecked")
<T extends TransportResponse> void sendResponse(TransportResponseHandler<T> handler, TransportResponse resp) {
threadPool.executor(ThreadPool.Names.MANAGEMENT).submit(new AbstractRunnable() {
threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION).submit(new AbstractRunnable() {
@Override
public void onFailure(Exception e) {
throw new AssertionError(e);
Expand All @@ -909,7 +909,7 @@ protected void doRun() {
}

<T extends TransportResponse> void sendFailure(TransportResponseHandler<T> handler, Exception e) {
threadPool.executor(ThreadPool.Names.MANAGEMENT).submit(new AbstractRunnable() {
threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION).submit(new AbstractRunnable() {
@Override
public void onFailure(Exception e) {
throw new AssertionError(e);
Expand Down