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] Replaced "master" terminology in Log message #2593

Merged
merged 1 commit into from
Mar 25, 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 @@ -176,7 +176,7 @@ public void testFailsOnUnknownNode() throws Exception {
assertThat(e.getResponse().getStatusLine().getStatusCode(), is(400));
assertThat(
e.getMessage(),
Matchers.containsString("add voting config exclusions request for [invalid] matched no master-eligible nodes")
Matchers.containsString("add voting config exclusions request for [invalid] matched no cluster-manager-eligible nodes")
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public void test3MasterNodes2Failed() throws Exception {
internalCluster().setBootstrapMasterNodeIndex(2);
List<String> masterNodes = new ArrayList<>();

logger.info("--> start 1st master-eligible node");
logger.info("--> start 1st cluster-manager-eligible node");
masterNodes.add(
internalCluster().startMasterOnlyNode(
Settings.builder().put(DiscoverySettings.INITIAL_STATE_TIMEOUT_SETTING.getKey(), "0s").build()
Expand All @@ -299,7 +299,7 @@ public void test3MasterNodes2Failed() throws Exception {
Settings.builder().put(DiscoverySettings.INITIAL_STATE_TIMEOUT_SETTING.getKey(), "0s").build()
); // node ordinal 1

logger.info("--> start 2nd and 3rd master-eligible nodes and bootstrap");
logger.info("--> start 2nd and 3rd cluster-manager-eligible nodes and bootstrap");
masterNodes.addAll(internalCluster().startMasterOnlyNodes(2)); // node ordinals 2 and 3

logger.info("--> wait for all nodes to join the cluster");
Expand Down Expand Up @@ -335,19 +335,19 @@ public void test3MasterNodes2Failed() throws Exception {
assertTrue(state.blocks().hasGlobalBlockWithId(NoMasterBlockService.NO_MASTER_BLOCK_ID));
});

logger.info("--> try to unsafely bootstrap 1st master-eligible node, while node lock is held");
logger.info("--> try to unsafely bootstrap 1st cluster-manager-eligible node, while node lock is held");
Environment environmentMaster1 = TestEnvironment.newEnvironment(
Settings.builder().put(internalCluster().getDefaultSettings()).put(master1DataPathSettings).build()
);
expectThrows(() -> unsafeBootstrap(environmentMaster1), UnsafeBootstrapMasterCommand.FAILED_TO_OBTAIN_NODE_LOCK_MSG);

logger.info("--> stop 1st master-eligible node and data-only node");
logger.info("--> stop 1st cluster-manager-eligible node and data-only node");
NodeEnvironment nodeEnvironment = internalCluster().getMasterNodeInstance(NodeEnvironment.class);
internalCluster().stopRandomNode(InternalTestCluster.nameFilter(masterNodes.get(0)));
assertBusy(() -> internalCluster().getInstance(GatewayMetaState.class, dataNode).allPendingAsyncStatesWritten());
internalCluster().stopRandomDataNode();

logger.info("--> unsafely-bootstrap 1st master-eligible node");
logger.info("--> unsafely-bootstrap 1st cluster-manager-eligible node");
MockTerminal terminal = unsafeBootstrap(environmentMaster1, false, true);
Metadata metadata = OpenSearchNodeCommand.createPersistedClusterStateService(Settings.EMPTY, nodeEnvironment.nodeDataPaths())
.loadBestOnDiskState().metadata;
Expand All @@ -363,7 +363,7 @@ public void test3MasterNodes2Failed() throws Exception {
)
);

logger.info("--> start 1st master-eligible node");
logger.info("--> start 1st cluster-manager-eligible node");
String masterNode2 = internalCluster().startMasterOnlyNode(master1DataPathSettings);

logger.info("--> detach-cluster on data-only node");
Expand Down Expand Up @@ -399,7 +399,7 @@ public void test3MasterNodes2Failed() throws Exception {
IndexMetadata indexMetadata = clusterService().state().metadata().index("test");
assertThat(indexMetadata.getSettings().get(IndexMetadata.SETTING_HISTORY_UUID), notNullValue());

logger.info("--> detach-cluster on 2nd and 3rd master-eligible nodes");
logger.info("--> detach-cluster on 2nd and 3rd cluster-manager-eligible nodes");
Environment environmentMaster2 = TestEnvironment.newEnvironment(
Settings.builder().put(internalCluster().getDefaultSettings()).put(master2DataPathSettings).build()
);
Expand All @@ -409,7 +409,7 @@ public void test3MasterNodes2Failed() throws Exception {
);
detachCluster(environmentMaster3, false);

logger.info("--> start 2nd and 3rd master-eligible nodes and ensure 4 nodes stable cluster");
logger.info("--> start 2nd and 3rd cluster-manager-eligible nodes and ensure 4 nodes stable cluster");
bootstrappedNodes.add(internalCluster().startMasterOnlyNode(master2DataPathSettings));
bootstrappedNodes.add(internalCluster().startMasterOnlyNode(master3DataPathSettings));
ensureStableCluster(4);
Expand All @@ -422,7 +422,7 @@ public void testAllMasterEligibleNodesFailedDanglingIndexImport() throws Excepti

Settings settings = Settings.builder().put(AUTO_IMPORT_DANGLING_INDICES_SETTING.getKey(), true).build();

logger.info("--> start mixed data and master-eligible node and bootstrap cluster");
logger.info("--> start mixed data and cluster-manager-eligible node and bootstrap cluster");
String masterNode = internalCluster().startNode(settings); // node ordinal 0

logger.info("--> start data-only node and ensure 2 nodes stable cluster");
Expand Down Expand Up @@ -457,7 +457,7 @@ public void testAllMasterEligibleNodesFailedDanglingIndexImport() throws Excepti
);
detachCluster(environment, false);

logger.info("--> stop master-eligible node, clear its data and start it again - new cluster should form");
logger.info("--> stop cluster-manager-eligible node, clear its data and start it again - new cluster should form");
internalCluster().restartNode(masterNode, new InternalTestCluster.RestartCallback() {
@Override
public boolean clearData(String nodeName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,8 @@ public void testSnapshotWithStuckNode() throws Exception {
try {
assertAcked(deleteSnapshotResponseFuture.actionGet());
} catch (SnapshotMissingException ex) {
// When master node is closed during this test, it sometime manages to delete the snapshot files before
// completely stopping. In this case the retried delete snapshot operation on the new master can fail
// When cluster-manager node is closed during this test, it sometime manages to delete the snapshot files before
// completely stopping. In this case the retried delete snapshot operation on the new cluster-manager can fail
// with SnapshotMissingException
}

Expand Down Expand Up @@ -759,7 +759,7 @@ public void testRegistrationFailure() {
logger.info("--> start first node");
internalCluster().startNode();
logger.info("--> start second node");
// Make sure the first node is elected as master
// Make sure the first node is elected as cluster-manager
internalCluster().startNode(nonMasterNode());
// Register mock repositories
for (int i = 0; i < 5; i++) {
Expand Down Expand Up @@ -836,7 +836,7 @@ public void sendResponse(RestResponse response) {
}

public void testMasterShutdownDuringSnapshot() throws Exception {
logger.info("--> starting two master nodes and two data nodes");
logger.info("--> starting two cluster-manager nodes and two data nodes");
internalCluster().startMasterOnlyNodes(2);
internalCluster().startDataOnlyNodes(2);

Expand All @@ -859,7 +859,7 @@ public void testMasterShutdownDuringSnapshot() throws Exception {
.setIndices("test-idx")
.get();

logger.info("--> stopping master node");
logger.info("--> stopping cluster-manager node");
internalCluster().stopCurrentMasterNode();

logger.info("--> wait until the snapshot is done");
Expand All @@ -874,7 +874,7 @@ public void testMasterShutdownDuringSnapshot() throws Exception {
}

public void testMasterAndDataShutdownDuringSnapshot() throws Exception {
logger.info("--> starting three master nodes and two data nodes");
logger.info("--> starting three cluster-manager nodes and two data nodes");
internalCluster().startMasterOnlyNodes(3);
internalCluster().startDataOnlyNodes(2);

Expand Down Expand Up @@ -902,7 +902,7 @@ public void testMasterAndDataShutdownDuringSnapshot() throws Exception {

logger.info("--> stopping data node {}", dataNode);
stopNode(dataNode);
logger.info("--> stopping master node {} ", masterNode);
logger.info("--> stopping cluster-manager node {} ", masterNode);
internalCluster().stopCurrentMasterNode();

logger.info("--> wait until the snapshot is done");
Expand All @@ -925,7 +925,7 @@ public void testMasterAndDataShutdownDuringSnapshot() throws Exception {
* the cluster.
*/
public void testRestoreShrinkIndex() throws Exception {
logger.info("--> starting a master node and a data node");
logger.info("--> starting a cluster-manager node and a data node");
internalCluster().startMasterOnlyNode();
internalCluster().startDataOnlyNode();

Expand Down Expand Up @@ -1144,7 +1144,7 @@ public void testDeduplicateIndexMetadata() throws Exception {
}

public void testDataNodeRestartWithBusyMasterDuringSnapshot() throws Exception {
logger.info("--> starting a master node and two data nodes");
logger.info("--> starting a cluster-manager node and two data nodes");
internalCluster().startMasterOnlyNode();
internalCluster().startDataOnlyNodes(2);
final Path repoPath = randomRepoPath();
Expand Down Expand Up @@ -1200,7 +1200,7 @@ public void testDataNodeRestartWithBusyMasterDuringSnapshot() throws Exception {
}

public void testDataNodeRestartAfterShardSnapshotFailure() throws Exception {
logger.info("--> starting a master node and two data nodes");
logger.info("--> starting a cluster-manager node and two data nodes");
internalCluster().startMasterOnlyNode();
final List<String> dataNodes = internalCluster().startDataOnlyNodes(2);
final Path repoPath = randomRepoPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
import java.util.stream.StreamSupport;

/**
* A request to add voting config exclusions for certain master-eligible nodes, and wait for these nodes to be removed from the voting
* A request to add voting config exclusions for certain cluster-manager-eligible nodes, and wait for these nodes to be removed from the voting
* configuration.
*/
public class AddVotingConfigExclusionsRequest extends MasterNodeRequest<AddVotingConfigExclusionsRequest> {
Expand All @@ -66,7 +66,7 @@ public class AddVotingConfigExclusionsRequest extends MasterNodeRequest<AddVotin
private final TimeValue timeout;

/**
* Construct a request to add voting config exclusions for master-eligible nodes matching the given node names, and wait for a
* Construct a request to add voting config exclusions for cluster-manager-eligible nodes matching the given node names, and wait for a
* default 30 seconds for these exclusions to take effect, removing the nodes from the voting configuration.
* @param nodeNames Names of the nodes to add - see {@link AddVotingConfigExclusionsRequest#resolveVotingConfigExclusions(ClusterState)}
*/
Expand All @@ -75,7 +75,7 @@ public AddVotingConfigExclusionsRequest(String... nodeNames) {
}

/**
* Construct a request to add voting config exclusions for master-eligible nodes matching the given descriptions, and wait for these
* Construct a request to add voting config exclusions for cluster-manager-eligible nodes matching the given descriptions, and wait for these
* nodes to be removed from the voting configuration.
* @param nodeDescriptions Descriptions of the nodes whose exclusions to add - see {@link DiscoveryNodes#resolveNodes(String...)}.
* @param nodeIds Ids of the nodes whose exclusions to add - see
Expand Down Expand Up @@ -136,7 +136,9 @@ Set<VotingConfigExclusion> resolveVotingConfigExclusions(ClusterState currentSta

if (newVotingConfigExclusions.isEmpty()) {
throw new IllegalArgumentException(
"add voting config exclusions request for " + Arrays.asList(nodeDescriptions) + " matched no master-eligible nodes"
"add voting config exclusions request for "
+ Arrays.asList(nodeDescriptions)
+ " matched no cluster-manager-eligible nodes"
);
}
} else if (nodeIds.length >= 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
* InternalClusterInfoService provides the ClusterInfoService interface,
* routinely updated on a timer. The timer can be dynamically changed by
* setting the <code>cluster.info.update.interval</code> setting (defaulting
* to 30 seconds). The InternalClusterInfoService only runs on the master node.
* to 30 seconds). The InternalClusterInfoService only runs on the cluster-manager node.
* Listens for changes in the number of data nodes and immediately submits a
* ClusterInfoUpdateJob if a node has been added.
*
Expand Down Expand Up @@ -109,7 +109,7 @@ public class InternalClusterInfoService implements ClusterInfoService, ClusterSt
private volatile ImmutableOpenMap<String, DiskUsage> leastAvailableSpaceUsages;
private volatile ImmutableOpenMap<String, DiskUsage> mostAvailableSpaceUsages;
private volatile IndicesStatsSummary indicesStatsSummary;
// null if this node is not currently the master
// null if this node is not currently the cluster-manager
private final AtomicReference<RefreshAndRescheduleRunnable> refreshAndRescheduleRunnable = new AtomicReference<>();
private volatile boolean enabled;
private volatile TimeValue fetchTimeout;
Expand Down Expand Up @@ -150,8 +150,8 @@ void setUpdateFrequency(TimeValue updateFrequency) {
@Override
public void clusterChanged(ClusterChangedEvent event) {
if (event.localNodeMaster() && refreshAndRescheduleRunnable.get() == null) {
logger.trace("elected as master, scheduling cluster info update tasks");
executeRefresh(event.state(), "became master");
logger.trace("elected as cluster-manager, scheduling cluster info update tasks");
executeRefresh(event.state(), "became cluster-manager");

final RefreshAndRescheduleRunnable newRunnable = new RefreshAndRescheduleRunnable();
refreshAndRescheduleRunnable.set(newRunnable);
Expand Down Expand Up @@ -535,7 +535,7 @@ protected void doRun() {
if (this == refreshAndRescheduleRunnable.get()) {
super.doRun();
} else {
logger.trace("master changed, scheduled refresh job is stale");
logger.trace("cluster-manager changed, scheduled refresh job is stale");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public ClusterBootstrapService(
+ DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey()
+ "] set to ["
+ DiscoveryModule.SINGLE_NODE_DISCOVERY_TYPE
+ "] must be master-eligible"
+ "] must be cluster-manager-eligible"
);
}
bootstrapRequirements = Collections.singleton(Node.NODE_NAME_SETTING.get(settings));
Expand Down Expand Up @@ -219,7 +219,7 @@ void scheduleUnconfiguredBootstrap() {

logger.info(
"no discovery configuration found, will perform best-effort cluster bootstrapping after [{}] "
+ "unless existing master is discovered",
+ "unless existing cluster-manager is discovered",
unconfiguredBootstrapTimeout
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ String getDescription() {
);

if (clusterState.nodes().getLocalNode().isMasterNode() == false) {
return String.format(Locale.ROOT, "master not discovered yet: %s", discoveryStateIgnoringQuorum);
return String.format(Locale.ROOT, "cluster-manager not discovered yet: %s", discoveryStateIgnoringQuorum);
}

if (clusterState.getLastAcceptedConfiguration().isEmpty()) {
Expand All @@ -203,14 +203,14 @@ String getDescription() {
} else {
bootstrappingDescription = String.format(
Locale.ROOT,
"this node must discover master-eligible nodes %s to bootstrap a cluster",
"this node must discover cluster-manager-eligible nodes %s to bootstrap a cluster",
INITIAL_CLUSTER_MANAGER_NODES_SETTING.get(settings)
);
}

return String.format(
Locale.ROOT,
"master not discovered yet, this node has not previously joined a bootstrapped cluster, and %s: %s",
"cluster-manager not discovered yet, this node has not previously joined a bootstrapped cluster, and %s: %s",
bootstrappingDescription,
discoveryStateIgnoringQuorum
);
Expand All @@ -221,7 +221,7 @@ String getDescription() {
if (clusterState.getLastCommittedConfiguration().equals(VotingConfiguration.MUST_JOIN_ELECTED_MASTER)) {
return String.format(
Locale.ROOT,
"master not discovered yet and this node was detached from its previous cluster, have discovered %s; %s",
"cluster-manager not discovered yet and this node was detached from its previous cluster, have discovered %s; %s",
foundPeers,
discoveryWillContinueDescription
);
Expand Down Expand Up @@ -250,7 +250,7 @@ String getDescription() {

return String.format(
Locale.ROOT,
"master not discovered or elected yet, an election requires %s, have discovered %s which %s; %s",
"cluster-manager not discovered or elected yet, an election requires %s, have discovered %s which %s; %s",
quorumDescription,
foundPeers,
isQuorumOrNot,
Expand All @@ -269,8 +269,8 @@ private String describeQuorum(VotingConfiguration votingConfiguration) {

if (nodeIds.size() == 1) {
if (nodeIds.contains(GatewayMetaState.STALE_STATE_CONFIG_NODE_ID)) {
return "one or more nodes that have already participated as master-eligible nodes in the cluster but this node was "
+ "not master-eligible the last time it joined the cluster";
return "one or more nodes that have already participated as cluster-manager-eligible nodes in the cluster but this node was "
+ "not cluster-manager-eligible the last time it joined the cluster";
} else {
return "a node with id " + realNodeIds;
}
Expand Down
Loading