Skip to content

Commit

Permalink
Fixing cluster state
Browse files Browse the repository at this point in the history
  • Loading branch information
gbbafna committed Sep 1, 2023
1 parent 215b936 commit 6144fc8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public ClusterTasksResult<Task> execute(ClusterState currentState, List<Task> jo
* join. See
* {@link org.opensearch.gateway.GatewayMetaState#prepareInitialClusterState(TransportService, ClusterService, ClusterState)} **/
newState = ClusterState.builder(
remoteStoreService.updateClusterStateRepositoriesMetadata(new RemoteStoreNode(node), currentState)
remoteStoreService.updateClusterStateRepositoriesMetadata(new RemoteStoreNode(node), newState.build())
);
}
} else {
Expand All @@ -224,7 +224,7 @@ public ClusterTasksResult<Task> execute(ClusterState currentState, List<Task> jo
if (node.isRemoteStoreNode()) {
// Try updating repositories metadata in cluster state once its compatible with the cluster.
newState = ClusterState.builder(
remoteStoreService.updateClusterStateRepositoriesMetadata(new RemoteStoreNode(node), currentState)
remoteStoreService.updateClusterStateRepositoriesMetadata(new RemoteStoreNode(node), newState.build())
);
}
} catch (IllegalArgumentException | IllegalStateException | NodeDecommissionedException e) {
Expand Down

0 comments on commit 6144fc8

Please sign in to comment.