Skip to content

Commit 25d411e

Browse files
authored
Remove undocumented action.master.force_local setting (#29351)
`action.master.force_local` was only ever used internally and never documented. It was one of those settings that were automatically added to a tribe node, to make sure that cluster state read operations would work locally rather than failing when trying to forward the request to the master (as the tribe node never had a master). Given that we recently removed the tribe node, we can also remove this setting.
1 parent c95e753 commit 25d411e

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

server/src/main/java/org/elasticsearch/action/support/master/TransportMasterNodeReadAction.java

+1-10
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
2525
import org.elasticsearch.cluster.service.ClusterService;
2626
import org.elasticsearch.common.io.stream.Writeable;
27-
import org.elasticsearch.common.settings.Setting;
28-
import org.elasticsearch.common.settings.Setting.Property;
2927
import org.elasticsearch.common.settings.Settings;
3028
import org.elasticsearch.threadpool.ThreadPool;
3129
import org.elasticsearch.transport.TransportService;
@@ -39,11 +37,6 @@
3937
public abstract class TransportMasterNodeReadAction<Request extends MasterNodeReadRequest<Request>, Response extends ActionResponse>
4038
extends TransportMasterNodeAction<Request, Response> {
4139

42-
public static final Setting<Boolean> FORCE_LOCAL_SETTING =
43-
Setting.boolSetting("action.master.force_local", false, Property.NodeScope);
44-
45-
private final boolean forceLocal;
46-
4740
protected TransportMasterNodeReadAction(Settings settings, String actionName, TransportService transportService,
4841
ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters,
4942
IndexNameExpressionResolver indexNameExpressionResolver, Supplier<Request> request) {
@@ -61,19 +54,17 @@ protected TransportMasterNodeReadAction(Settings settings, String actionName, bo
6154
IndexNameExpressionResolver indexNameExpressionResolver, Supplier<Request> request) {
6255
super(settings, actionName, checkSizeLimit, transportService, clusterService, threadPool, actionFilters,
6356
indexNameExpressionResolver,request);
64-
this.forceLocal = FORCE_LOCAL_SETTING.get(settings);
6557
}
6658

6759
protected TransportMasterNodeReadAction(Settings settings, String actionName, boolean checkSizeLimit, TransportService transportService,
6860
ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters,
6961
Writeable.Reader<Request> request, IndexNameExpressionResolver indexNameExpressionResolver) {
7062
super(settings, actionName, checkSizeLimit, transportService, clusterService, threadPool, actionFilters, request,
7163
indexNameExpressionResolver);
72-
this.forceLocal = FORCE_LOCAL_SETTING.get(settings);
7364
}
7465

7566
@Override
7667
protected final boolean localExecute(Request request) {
77-
return forceLocal || request.local();
68+
return request.local();
7869
}
7970
}

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

-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.elasticsearch.action.search.TransportSearchAction;
2323
import org.elasticsearch.action.support.AutoCreateIndex;
2424
import org.elasticsearch.action.support.DestructiveOperations;
25-
import org.elasticsearch.action.support.master.TransportMasterNodeReadAction;
2625
import org.elasticsearch.bootstrap.BootstrapSettings;
2726
import org.elasticsearch.client.Client;
2827
import org.elasticsearch.client.transport.TransportClient;
@@ -373,7 +372,6 @@ public void apply(Settings value, Settings current, Settings previous) {
373372
Node.NODE_INGEST_SETTING,
374373
Node.NODE_ATTRIBUTES,
375374
Node.NODE_LOCAL_STORAGE_SETTING,
376-
TransportMasterNodeReadAction.FORCE_LOCAL_SETTING,
377375
AutoCreateIndex.AUTO_CREATE_INDEX_SETTING,
378376
BaseRestHandler.MULTI_ALLOW_EXPLICIT_INDEX,
379377
ClusterName.CLUSTER_NAME_SETTING,

0 commit comments

Comments
 (0)