Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Changed master nomenclature to cluster_manager #177

Merged
merged 1 commit into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ private void performPersistedResponseCleanUpAction(AsynchronousSearchCleanUpRequ

@Override
public void clusterChanged(ClusterChangedEvent event) {
if (event.localNodeMaster() && persistedResponseCleanUpRunnable.get() == null) {
if (event.localNodeClusterManager() && persistedResponseCleanUpRunnable.get() == null) {
logger.trace("elected as cluster_manager, triggering response cleanup tasks");
triggerCleanUp(event.state(), "became cluster_manager");

final PersistedResponseCleanUpAndRescheduleRunnable newRunnable = new PersistedResponseCleanUpAndRescheduleRunnable();
persistedResponseCleanUpRunnable.set(newRunnable);
threadPool.scheduleUnlessShuttingDown(persistedResponseCleanUpInterval, RESPONSE_CLEANUP_SCHEDULING_EXECUTOR, newRunnable);
} else if (event.localNodeMaster() == false) {
} else if (event.localNodeClusterManager() == false) {
persistedResponseCleanUpRunnable.set(null);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,17 @@ private static DiscoveryNodes createDiscoveryNodes(final int numNodes, final boo
if (i == 0) {
//local node id
builder.localNodeId(nodeId);
roles.add(DiscoveryNodeRole.MASTER_ROLE);
roles.add(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE);
} else if (i == 1) {
// the alternate cluster_manager node
roles.add(DiscoveryNodeRole.MASTER_ROLE);
roles.add(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE);
} else if (i == 2) {
// we need at least one data node
roles.add(DiscoveryNodeRole.DATA_ROLE);
} else {
// remaining nodes can be anything (except for cluster_manager)
if (randomBoolean()) {
roles.add(DiscoveryNodeRole.MASTER_ROLE);
roles.add(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE);
}
if (randomBoolean()) {
roles.add(DiscoveryNodeRole.DATA_ROLE);
Expand All @@ -238,7 +238,7 @@ private static DiscoveryNodes createDiscoveryNodes(final int numNodes, final boo
final DiscoveryNode node = newNode(nodeId, roles);
builder.add(node);
if (i == clusterManagerNodeIndex) {
builder.masterNodeId(nodeId);
builder.clusterManagerNodeId(nodeId);
}
}
return builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ public static ClusterService createClusterService(Settings settings, ThreadPool
.nodes(DiscoveryNodes.builder()
.add(localNode)
.localNodeId(localNode.getId())
.masterNodeId(localNode.getId()))
.clusterManagerNodeId(localNode.getId()))
.blocks(ClusterBlocks.EMPTY_CLUSTER_BLOCK).build();
clusterService.getClusterApplierService().setInitialState(initialClusterState);
clusterService.getMasterService().setClusterStatePublisher(
clusterService.getClusterManagerService().setClusterStatePublisher(
createClusterStatePublisher(clusterService.getClusterApplierService()));
clusterService.getMasterService().setClusterStateSupplier(clusterService.getClusterApplierService()::state);
clusterService.getClusterManagerService().setClusterStateSupplier(clusterService.getClusterApplierService()::state);
clusterService.start();
return clusterService;
}
Expand Down