Skip to content

Commit 34876d6

Browse files
committed
Fix on top of fix
1 parent bd160db commit 34876d6

File tree

5 files changed

+4
-23
lines changed

5 files changed

+4
-23
lines changed

server/src/internalClusterTest/java/org/elasticsearch/action/support/ActiveShardsObserverIT.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ public void testCreateIndexStopsWaitingWhenIndexDeleted() throws Exception {
135135
.execute();
136136

137137
logger.info("--> wait until the cluster state contains the new index");
138-
assertBusy(
139-
() -> assertTrue(clusterAdmin().prepareState(TEST_REQUEST_TIMEOUT).get().getState().metadata().getProject().hasIndex(indexName))
140-
);
138+
awaitClusterState(state -> state.metadata().getProject().hasIndex(indexName));
141139

142140
logger.info("--> delete the index");
143141
assertAcked(indicesAdmin().prepareDelete(indexName));

server/src/internalClusterTest/java/org/elasticsearch/discovery/DiscoveryDisruptionIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void testElectMasterWithLatestVersion() throws Exception {
146146

147147
isolateAllNodes.stopDisrupting();
148148

149-
final ClusterState state = clusterAdmin().prepareState(TEST_REQUEST_TIMEOUT).get().getState();
149+
final ClusterState state = clusterAdmin().prepareState(TEST_REQUEST_TIMEOUT).setWaitForMaster(true).get().getState();
150150
if (state.metadata().getProject().hasIndex("test") == false) {
151151
fail("index 'test' was lost. current cluster state: " + state);
152152
}

server/src/main/java/org/elasticsearch/action/ActionModule.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
import org.elasticsearch.action.admin.cluster.snapshots.status.TransportNodesSnapshotsStatus;
6868
import org.elasticsearch.action.admin.cluster.snapshots.status.TransportSnapshotsStatusAction;
6969
import org.elasticsearch.action.admin.cluster.state.ClusterStateAction;
70-
import org.elasticsearch.action.admin.cluster.state.RemoteClusterStateAction;
7170
import org.elasticsearch.action.admin.cluster.state.TransportClusterStateAction;
7271
import org.elasticsearch.action.admin.cluster.state.TransportRemoteClusterStateAction;
7372
import org.elasticsearch.action.admin.cluster.stats.TransportClusterStatsAction;
@@ -655,7 +654,6 @@ public <Request extends ActionRequest, Response extends ActionResponse> void reg
655654
actions.register(TransportDeleteDesiredBalanceAction.TYPE, TransportDeleteDesiredBalanceAction.class);
656655
actions.register(TransportClusterStatsAction.TYPE, TransportClusterStatsAction.class);
657656
actions.register(ClusterStateAction.INSTANCE, TransportClusterStateAction.class);
658-
actions.register(RemoteClusterStateAction.INSTANCE, TransportRemoteClusterStateAction.class);
659657
actions.register(TransportClusterHealthAction.TYPE, TransportClusterHealthAction.class);
660658
actions.register(ClusterUpdateSettingsAction.INSTANCE, TransportClusterUpdateSettingsAction.class);
661659
actions.register(ClusterGetSettingsAction.INSTANCE, TransportClusterGetSettingsAction.class);
@@ -1061,7 +1059,7 @@ protected void configure() {
10611059
bind(action.getTransportAction()).asEagerSingleton();
10621060
transportActionsBinder.addBinding(action.getAction()).to(action.getTransportAction()).asEagerSingleton();
10631061
}
1064-
1062+
bind(TransportRemoteClusterStateAction.class).asEagerSingleton();
10651063
}
10661064

10671065
public ActionFilters getActionFilters() {

server/src/main/java/org/elasticsearch/action/admin/cluster/state/RemoteClusterStateAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
public class RemoteClusterStateAction extends ActionType<ClusterStateResponse> {
1616

1717
public static final RemoteClusterStateAction INSTANCE = new RemoteClusterStateAction();
18-
public static final String NAME = "cluster:monitor/state_remote";
18+
public static final String NAME = "cluster:monitor/state";
1919
public static final RemoteClusterActionType<ClusterStateResponse> REMOTE_TYPE = new RemoteClusterActionType<>(
2020
NAME,
2121
ClusterStateResponse::new

server/src/main/java/org/elasticsearch/action/admin/cluster/state/TransportClusterStateAction.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.elasticsearch.action.ActionListener;
1515
import org.elasticsearch.action.ActionRunnable;
1616
import org.elasticsearch.action.support.ActionFilters;
17-
import org.elasticsearch.action.support.ChannelActionListener;
1817
import org.elasticsearch.action.support.local.TransportLocalClusterStateAction;
1918
import org.elasticsearch.cluster.ClusterState;
2019
import org.elasticsearch.cluster.ClusterStateObserver;
@@ -59,11 +58,6 @@ public class TransportClusterStateAction extends TransportLocalClusterStateActio
5958
private final IndexNameExpressionResolver indexNameExpressionResolver;
6059
private final ThreadPool threadPool;
6160

62-
/**
63-
* NB prior to 9.0 this was a TransportMasterNodeReadAction so for BwC it must be registered with the TransportService until
64-
* we no longer need to support calling this action remotely.
65-
*/
66-
@SuppressWarnings("this-escape")
6761
@Inject
6862
public TransportClusterStateAction(
6963
TransportService transportService,
@@ -83,15 +77,6 @@ public TransportClusterStateAction(
8377
this.projectResolver = projectResolver;
8478
this.indexNameExpressionResolver = indexNameExpressionResolver;
8579
this.threadPool = threadPool;
86-
87-
transportService.registerRequestHandler(
88-
actionName,
89-
executor,
90-
false,
91-
true,
92-
ClusterStateRequest::new,
93-
(request, channel, task) -> executeDirect(task, request, new ChannelActionListener<>(channel))
94-
);
9580
}
9681

9782
@Override

0 commit comments

Comments
 (0)