Skip to content

Commit

Permalink
Add fix to allow mixed mode join task
Browse files Browse the repository at this point in the history
Signed-off-by: Lakshya Taragi <[email protected]>
  • Loading branch information
ltaragi committed Mar 1, 2024
1 parent a53f53e commit bfa399c
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public class JoinTaskExecutor implements ClusterStateTaskExecutor<JoinTaskExecut

private final RemoteStoreNodeService remoteStoreNodeService;

private static Settings currentNodeSettings = Settings.EMPTY;

/**
* Task for the join task executor.
*
Expand Down Expand Up @@ -145,12 +147,16 @@ public JoinTaskExecutor(
this.logger = logger;
this.rerouteService = rerouteService;
this.remoteStoreNodeService = remoteStoreNodeService;
currentNodeSettings = settings;
}

public static Settings getCurrentNodeSettings() {
return currentNodeSettings;
}

@Override
public ClusterTasksResult<Task> execute(ClusterState currentState, List<Task> joiningNodes) throws Exception {
final ClusterTasksResult.Builder<Task> results = ClusterTasksResult.builder();

final DiscoveryNodes currentNodes = currentState.nodes();
boolean nodesChanged = false;
ClusterState.Builder newState;
Expand Down Expand Up @@ -507,9 +513,12 @@ private static void ensureRemoteStoreNodesCompatibility(DiscoveryNode joiningNod

assert existingNodes.isEmpty() == false;

CompatibilityMode remoteStoreCompatibilityMode = REMOTE_STORE_COMPATIBILITY_MODE_SETTING.get(metadata.settings());
if (STRICT.equals(remoteStoreCompatibilityMode)) {
CompatibilityMode remoteStoreCompatibilityMode = REMOTE_STORE_COMPATIBILITY_MODE_SETTING.get(getCurrentNodeSettings());
if (REMOTE_STORE_COMPATIBILITY_MODE_SETTING.exists(metadata.settings())) {
remoteStoreCompatibilityMode = REMOTE_STORE_COMPATIBILITY_MODE_SETTING.get(metadata.settings());
}

if (STRICT.equals(remoteStoreCompatibilityMode)) {
DiscoveryNode existingNode = existingNodes.get(0);
if (joiningNode.isRemoteStoreNode()) {
ensureRemoteStoreNodesCompatibility(joiningNode, existingNode);
Expand Down

0 comments on commit bfa399c

Please sign in to comment.