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

Move get-aliases handling onto management thread #74053

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -30,6 +30,7 @@
import org.elasticsearch.tasks.Task;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
import org.elasticsearch.transport.Transports;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -51,7 +52,7 @@ public TransportGetAliasesAction(TransportService transportService, ClusterServi
ThreadPool threadPool, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver, SystemIndices systemIndices) {
super(GetAliasesAction.NAME, transportService, clusterService, threadPool, actionFilters, GetAliasesRequest::new,
indexNameExpressionResolver, GetAliasesResponse::new, ThreadPool.Names.SAME);
indexNameExpressionResolver, GetAliasesResponse::new, ThreadPool.Names.MANAGEMENT);
this.systemIndices = systemIndices;
}

Expand All @@ -64,6 +65,7 @@ protected ClusterBlockException checkBlock(GetAliasesRequest request, ClusterSta

@Override
protected void masterOperation(Task task, GetAliasesRequest request, ClusterState state, ActionListener<GetAliasesResponse> listener) {
assert Transports.assertNotTransportThread("no need to avoid the context switch and may be expensive if there are many aliases");
// resolve all concrete indices upfront and warn/error later
final String[] concreteIndices = indexNameExpressionResolver.concreteIndexNamesWithSystemIndexAccess(state, request);
final SystemIndexAccessLevel systemIndexAccessLevel = indexNameExpressionResolver.getSystemIndexAccessLevel();
Expand Down