diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f025d2304966..cf285d79c3578 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - [S3 Repository] Add setting to control connection count for sync client ([#12028](https://github.com/opensearch-project/OpenSearch/pull/12028)) - Views, simplify data access and manipulation by providing a virtual layer over one or more indices ([#11957](https://github.com/opensearch-project/OpenSearch/pull/11957)) - Add Remote Store Migration Experimental flag and allow mixed mode clusters under same ([#11986](https://github.com/opensearch-project/OpenSearch/pull/11986)) - +- Light weight Transport action to verify local term before fetching cluster-state from remote ([#12252](https://github.com/opensearch-project/OpenSearch/pull/12252/)) ### Dependencies - Bump `log4j-core` from 2.18.0 to 2.19.0 - Bump `forbiddenapis` from 3.3 to 3.4 diff --git a/server/src/main/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeAction.java b/server/src/main/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeAction.java index a976dd87ca213..cc4f802653202 100644 --- a/server/src/main/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeAction.java +++ b/server/src/main/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeAction.java @@ -353,8 +353,8 @@ private ActionListener getDelegateForLocalExecute(ClusterState cluster } protected BiConsumer clusterStateLatestChecker( - Consumer onLatestWithLocalState, - BiConsumer onMisMatchWithLocalState + Consumer onLatestLocalState, + BiConsumer onStaleLocalState ) { return (clusterManagerNode, clusterState) -> { transportService.sendRequest( @@ -371,9 +371,9 @@ public void handleResponse(GetTermVersionResponse response) { isLatestClusterStatePresentOnLocalNode ); if (isLatestClusterStatePresentOnLocalNode) { - onLatestWithLocalState.accept(clusterState); + onLatestLocalState.accept(clusterState); } else { - onMisMatchWithLocalState.accept(clusterManagerNode, clusterState); + onStaleLocalState.accept(clusterManagerNode, clusterState); } } diff --git a/server/src/test/java/org/opensearch/action/support/clustermanager/TransportClusterManagerTermCheckTests.java b/server/src/test/java/org/opensearch/action/support/clustermanager/TransportClusterManagerTermCheckTests.java index d22d4871d92af..9e92c76d96aad 100644 --- a/server/src/test/java/org/opensearch/action/support/clustermanager/TransportClusterManagerTermCheckTests.java +++ b/server/src/test/java/org/opensearch/action/support/clustermanager/TransportClusterManagerTermCheckTests.java @@ -276,7 +276,7 @@ public void testTermCheckNoMatchWithClusterManager() throws ExecutionException, public void testTermCheckOnOldVersionClusterManager() throws ExecutionException, InterruptedException { - setUpCluster(Version.V_2_13_0); + setUpCluster(Version.V_2_12_0); TransportClusterManagerTermCheckTests.Request request = new TransportClusterManagerTermCheckTests.Request(); PlainActionFuture listener = new PlainActionFuture<>();