Skip to content

Commit d4b67dc

Browse files
Replaced "master" terminology in Log message (#2575) (#2593)
Changed the log message to cluster-manager from master Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> (cherry picked from commit cc0e66b)
1 parent abd5ce7 commit d4b67dc

30 files changed

Lines changed: 135 additions & 122 deletions

modules/transport-netty4/src/internalClusterTest/java/org/opensearch/rest/discovery/Zen2RestApiIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public void testFailsOnUnknownNode() throws Exception {
176176
assertThat(e.getResponse().getStatusLine().getStatusCode(), is(400));
177177
assertThat(
178178
e.getMessage(),
179-
Matchers.containsString("add voting config exclusions request for [invalid] matched no master-eligible nodes")
179+
Matchers.containsString("add voting config exclusions request for [invalid] matched no cluster-manager-eligible nodes")
180180
);
181181
}
182182
}

server/src/internalClusterTest/java/org/opensearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public void test3MasterNodes2Failed() throws Exception {
287287
internalCluster().setBootstrapMasterNodeIndex(2);
288288
List<String> masterNodes = new ArrayList<>();
289289

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

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

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

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

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

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

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

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

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

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

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

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

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

460-
logger.info("--> stop master-eligible node, clear its data and start it again - new cluster should form");
460+
logger.info("--> stop cluster-manager-eligible node, clear its data and start it again - new cluster should form");
461461
internalCluster().restartNode(masterNode, new InternalTestCluster.RestartCallback() {
462462
@Override
463463
public boolean clearData(String nodeName) {

server/src/internalClusterTest/java/org/opensearch/snapshots/DedicatedClusterSnapshotRestoreIT.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ public void testSnapshotWithStuckNode() throws Exception {
482482
try {
483483
assertAcked(deleteSnapshotResponseFuture.actionGet());
484484
} catch (SnapshotMissingException ex) {
485-
// When master node is closed during this test, it sometime manages to delete the snapshot files before
486-
// completely stopping. In this case the retried delete snapshot operation on the new master can fail
485+
// When cluster-manager node is closed during this test, it sometime manages to delete the snapshot files before
486+
// completely stopping. In this case the retried delete snapshot operation on the new cluster-manager can fail
487487
// with SnapshotMissingException
488488
}
489489

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

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

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

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

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

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

@@ -902,7 +902,7 @@ public void testMasterAndDataShutdownDuringSnapshot() throws Exception {
902902

903903
logger.info("--> stopping data node {}", dataNode);
904904
stopNode(dataNode);
905-
logger.info("--> stopping master node {} ", masterNode);
905+
logger.info("--> stopping cluster-manager node {} ", masterNode);
906906
internalCluster().stopCurrentMasterNode();
907907

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

@@ -1144,7 +1144,7 @@ public void testDeduplicateIndexMetadata() throws Exception {
11441144
}
11451145

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

12021202
public void testDataNodeRestartAfterShardSnapshotFailure() throws Exception {
1203-
logger.info("--> starting a master node and two data nodes");
1203+
logger.info("--> starting a cluster-manager node and two data nodes");
12041204
internalCluster().startMasterOnlyNode();
12051205
final List<String> dataNodes = internalCluster().startDataOnlyNodes(2);
12061206
final Path repoPath = randomRepoPath();

server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
import java.util.stream.StreamSupport;
5555

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

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

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

137137
if (newVotingConfigExclusions.isEmpty()) {
138138
throw new IllegalArgumentException(
139-
"add voting config exclusions request for " + Arrays.asList(nodeDescriptions) + " matched no master-eligible nodes"
139+
"add voting config exclusions request for "
140+
+ Arrays.asList(nodeDescriptions)
141+
+ " matched no cluster-manager-eligible nodes"
140142
);
141143
}
142144
} else if (nodeIds.length >= 1) {

server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
* InternalClusterInfoService provides the ClusterInfoService interface,
7878
* routinely updated on a timer. The timer can be dynamically changed by
7979
* setting the <code>cluster.info.update.interval</code> setting (defaulting
80-
* to 30 seconds). The InternalClusterInfoService only runs on the master node.
80+
* to 30 seconds). The InternalClusterInfoService only runs on the cluster-manager node.
8181
* Listens for changes in the number of data nodes and immediately submits a
8282
* ClusterInfoUpdateJob if a node has been added.
8383
*
@@ -109,7 +109,7 @@ public class InternalClusterInfoService implements ClusterInfoService, ClusterSt
109109
private volatile ImmutableOpenMap<String, DiskUsage> leastAvailableSpaceUsages;
110110
private volatile ImmutableOpenMap<String, DiskUsage> mostAvailableSpaceUsages;
111111
private volatile IndicesStatsSummary indicesStatsSummary;
112-
// null if this node is not currently the master
112+
// null if this node is not currently the cluster-manager
113113
private final AtomicReference<RefreshAndRescheduleRunnable> refreshAndRescheduleRunnable = new AtomicReference<>();
114114
private volatile boolean enabled;
115115
private volatile TimeValue fetchTimeout;
@@ -150,8 +150,8 @@ void setUpdateFrequency(TimeValue updateFrequency) {
150150
@Override
151151
public void clusterChanged(ClusterChangedEvent event) {
152152
if (event.localNodeMaster() && refreshAndRescheduleRunnable.get() == null) {
153-
logger.trace("elected as master, scheduling cluster info update tasks");
154-
executeRefresh(event.state(), "became master");
153+
logger.trace("elected as cluster-manager, scheduling cluster info update tasks");
154+
executeRefresh(event.state(), "became cluster-manager");
155155

156156
final RefreshAndRescheduleRunnable newRunnable = new RefreshAndRescheduleRunnable();
157157
refreshAndRescheduleRunnable.set(newRunnable);
@@ -535,7 +535,7 @@ protected void doRun() {
535535
if (this == refreshAndRescheduleRunnable.get()) {
536536
super.doRun();
537537
} else {
538-
logger.trace("master changed, scheduled refresh job is stale");
538+
logger.trace("cluster-manager changed, scheduled refresh job is stale");
539539
}
540540
}
541541

server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public ClusterBootstrapService(
135135
+ DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey()
136136
+ "] set to ["
137137
+ DiscoveryModule.SINGLE_NODE_DISCOVERY_TYPE
138-
+ "] must be master-eligible"
138+
+ "] must be cluster-manager-eligible"
139139
);
140140
}
141141
bootstrapRequirements = Collections.singleton(Node.NODE_NAME_SETTING.get(settings));
@@ -219,7 +219,7 @@ void scheduleUnconfiguredBootstrap() {
219219

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

server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ String getDescription() {
192192
);
193193

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

198198
if (clusterState.getLastAcceptedConfiguration().isEmpty()) {
@@ -203,14 +203,14 @@ String getDescription() {
203203
} else {
204204
bootstrappingDescription = String.format(
205205
Locale.ROOT,
206-
"this node must discover master-eligible nodes %s to bootstrap a cluster",
206+
"this node must discover cluster-manager-eligible nodes %s to bootstrap a cluster",
207207
INITIAL_CLUSTER_MANAGER_NODES_SETTING.get(settings)
208208
);
209209
}
210210

211211
return String.format(
212212
Locale.ROOT,
213-
"master not discovered yet, this node has not previously joined a bootstrapped cluster, and %s: %s",
213+
"cluster-manager not discovered yet, this node has not previously joined a bootstrapped cluster, and %s: %s",
214214
bootstrappingDescription,
215215
discoveryStateIgnoringQuorum
216216
);
@@ -221,7 +221,7 @@ String getDescription() {
221221
if (clusterState.getLastCommittedConfiguration().equals(VotingConfiguration.MUST_JOIN_ELECTED_MASTER)) {
222222
return String.format(
223223
Locale.ROOT,
224-
"master not discovered yet and this node was detached from its previous cluster, have discovered %s; %s",
224+
"cluster-manager not discovered yet and this node was detached from its previous cluster, have discovered %s; %s",
225225
foundPeers,
226226
discoveryWillContinueDescription
227227
);
@@ -250,7 +250,7 @@ String getDescription() {
250250

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

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

0 commit comments

Comments
 (0)