From 8cb690cd3875e975f0d3b50d737a79227ee6984d Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Fri, 13 May 2022 16:29:42 -0700 Subject: [PATCH] Replace 'master' terminology with 'cluster manager' in server/src/internalClusterTest directory Signed-off-by: Tianli Feng --- .../master/IndexingMasterFailoverIT.java | 6 +-- .../opensearch/cluster/ClusterHealthIT.java | 11 +++--- .../cluster/ClusterInfoServiceIT.java | 2 +- .../cluster/MinimumMasterNodesIT.java | 26 ++++++------- .../opensearch/cluster/NoMasterNodeIT.java | 2 +- .../cluster/SpecificMasterNodesIT.java | 22 +++++------ .../action/shard/ShardStateActionIT.java | 5 ++- .../coordination/RareClusterStateIT.java | 38 +++++++++---------- .../cluster/routing/AllocationIdIT.java | 2 +- .../cluster/routing/PrimaryAllocationIT.java | 21 +++++----- .../decider/DiskThresholdDeciderIT.java | 2 +- .../org/opensearch/env/NodeEnvironmentIT.java | 4 +- .../env/NodeRepurposeCommandIT.java | 4 +- .../gateway/GatewayIndexStateIT.java | 10 ++--- .../gateway/RecoverAfterNodesIT.java | 8 ++-- .../gateway/RecoveryFromGatewayIT.java | 4 +- .../index/mapper/DynamicMappingIT.java | 2 +- .../mapping/UpdateMappingIntegrationIT.java | 2 +- .../state/CloseWhileRelocatingShardsIT.java | 2 +- .../store/IndicesStoreIntegrationIT.java | 2 +- .../recovery/FullRollingRestartIT.java | 2 +- 21 files changed, 91 insertions(+), 86 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/action/support/master/IndexingMasterFailoverIT.java b/server/src/internalClusterTest/java/org/opensearch/action/support/master/IndexingMasterFailoverIT.java index b4e4c058be198..2a124d9e23607 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/support/master/IndexingMasterFailoverIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/support/master/IndexingMasterFailoverIT.java @@ -74,7 +74,7 @@ public void testMasterFailoverDuringIndexingWithMappingChanges() throws Throwabl logger.info("--> wait for all nodes to join the cluster"); ensureStableCluster(4); - // We index data with mapping changes into cluster and have master failover at same time + // We index data with mapping changes into cluster and have cluster-manager failover at same time client().admin() .indices() .prepareCreate("myindex") @@ -108,14 +108,14 @@ public void run() { barrier.await(); - // interrupt communication between master and other nodes in cluster + // interrupt communication between cluster-manager and other nodes in cluster NetworkDisruption partition = isolateMasterDisruption(NetworkDisruption.DISCONNECT); internalCluster().setDisruptionScheme(partition); logger.info("--> disrupting network"); partition.startDisrupting(); - logger.info("--> waiting for new master to be elected"); + logger.info("--> waiting for new cluster-manager to be elected"); ensureStableCluster(3, dataNode); partition.stopDisrupting(); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterHealthIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterHealthIT.java index 393ab8e5a7544..8aea483c54e3b 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterHealthIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterHealthIT.java @@ -60,7 +60,7 @@ public class ClusterHealthIT extends OpenSearchIntegTestCase { public void testSimpleLocalHealth() { createIndex("test"); - ensureGreen(); // master should think it's green now. + ensureGreen(); // cluster-manager should think it's green now. for (final String node : internalCluster().getNodeNames()) { // a very high time out, which should never fire due to the local flag @@ -350,10 +350,10 @@ public void testHealthOnMasterFailover() throws Exception { final String node = internalCluster().startDataOnlyNode(); final boolean withIndex = randomBoolean(); if (withIndex) { - // Create index with many shards to provoke the health request to wait (for green) while master is being shut down. - // Notice that this is set to 0 after the test completed starting a number of health requests and master restarts. + // Create index with many shards to provoke the health request to wait (for green) while cluster-manager is being shut down. + // Notice that this is set to 0 after the test completed starting a number of health requests and cluster-manager restarts. // This ensures that the cluster is yellow when the health request is made, making the health request wait on the observer, - // triggering a call to observer.onClusterServiceClose when master is shutdown. + // triggering a call to observer.onClusterServiceClose when cluster-manager is shutdown. createIndex( "test", Settings.builder() @@ -364,7 +364,8 @@ public void testHealthOnMasterFailover() throws Exception { ); } final List> responseFutures = new ArrayList<>(); - // Run a few health requests concurrent to master fail-overs against a data-node to make sure master failover is handled + // Run a few health requests concurrent to cluster-manager fail-overs against a data-node to make sure cluster-manager failover is + // handled // without exceptions final int iterations = withIndex ? 10 : 20; for (int i = 0; i < iterations; ++i) { diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterInfoServiceIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterInfoServiceIT.java index e8ea0bb933a3e..dae9505fe67bf 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterInfoServiceIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterInfoServiceIT.java @@ -166,7 +166,7 @@ public void testClusterInfoServiceCollectsInformation() { } ensureGreen(indexName); InternalTestCluster internalTestCluster = internalCluster(); - // Get the cluster info service on the master node + // Get the cluster info service on the cluster-manager node final InternalClusterInfoService infoService = (InternalClusterInfoService) internalTestCluster.getInstance( ClusterInfoService.class, internalTestCluster.getMasterName() diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java index 4981da39197c3..0e442334abca7 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java @@ -151,13 +151,13 @@ public void testTwoNodesNoMasterBlock() throws Exception { ); } - String masterNode = internalCluster().getMasterName(); - String otherNode = node1Name.equals(masterNode) ? node2Name : node1Name; - logger.info("--> add voting config exclusion for non-master node, to be sure it's not elected"); + String clusterManagerNode = internalCluster().getMasterName(); + String otherNode = node1Name.equals(clusterManagerNode) ? node2Name : node1Name; + logger.info("--> add voting config exclusion for non-cluster-manager node, to be sure it's not elected"); client().execute(AddVotingConfigExclusionsAction.INSTANCE, new AddVotingConfigExclusionsRequest(otherNode)).get(); - logger.info("--> stop master node, no cluster-manager block should appear"); - Settings masterDataPathSettings = internalCluster().dataPathSettings(masterNode); - internalCluster().stopRandomNode(InternalTestCluster.nameFilter(masterNode)); + logger.info("--> stop cluster-manager node, no cluster-manager block should appear"); + Settings masterDataPathSettings = internalCluster().dataPathSettings(clusterManagerNode); + internalCluster().stopRandomNode(InternalTestCluster.nameFilter(clusterManagerNode)); assertBusy(() -> { ClusterState clusterState = client().admin().cluster().prepareState().setLocal(true).execute().actionGet().getState(); @@ -170,7 +170,7 @@ public void testTwoNodesNoMasterBlock() throws Exception { assertThat(state.nodes().getSize(), equalTo(2)); assertThat(state.nodes().getMasterNode(), equalTo(null)); - logger.info("--> starting the previous master node again..."); + logger.info("--> starting the previous cluster-manager node again..."); node2Name = internalCluster().startNode(Settings.builder().put(settings).put(masterDataPathSettings).build()); clusterHealthResponse = client().admin() @@ -204,11 +204,11 @@ public void testTwoNodesNoMasterBlock() throws Exception { clearRequest.setWaitForRemoval(false); client().execute(ClearVotingConfigExclusionsAction.INSTANCE, clearRequest).get(); - masterNode = internalCluster().getMasterName(); - otherNode = node1Name.equals(masterNode) ? node2Name : node1Name; - logger.info("--> add voting config exclusion for master node, to be sure it's not elected"); - client().execute(AddVotingConfigExclusionsAction.INSTANCE, new AddVotingConfigExclusionsRequest(masterNode)).get(); - logger.info("--> stop non-master node, no cluster-manager block should appear"); + clusterManagerNode = internalCluster().getMasterName(); + otherNode = node1Name.equals(clusterManagerNode) ? node2Name : node1Name; + logger.info("--> add voting config exclusion for cluster-manager node, to be sure it's not elected"); + client().execute(AddVotingConfigExclusionsAction.INSTANCE, new AddVotingConfigExclusionsRequest(clusterManagerNode)).get(); + logger.info("--> stop non-cluster-manager node, no cluster-manager block should appear"); Settings otherNodeDataPathSettings = internalCluster().dataPathSettings(otherNode); internalCluster().stopRandomNode(InternalTestCluster.nameFilter(otherNode)); @@ -217,7 +217,7 @@ public void testTwoNodesNoMasterBlock() throws Exception { assertThat(state1.blocks().hasGlobalBlockWithId(NoMasterBlockService.NO_MASTER_BLOCK_ID), equalTo(true)); }); - logger.info("--> starting the previous master node again..."); + logger.info("--> starting the previous cluster-manager node again..."); internalCluster().startNode(Settings.builder().put(settings).put(otherNodeDataPathSettings).build()); ensureGreen(); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/NoMasterNodeIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/NoMasterNodeIT.java index 5226eed2b6610..2c50c2051b34a 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/NoMasterNodeIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/NoMasterNodeIT.java @@ -216,7 +216,7 @@ public void testNoMasterActions() throws Exception { } void checkUpdateAction(boolean autoCreateIndex, TimeValue timeout, ActionRequestBuilder builder) { - // we clean the metadata when loosing a master, therefore all operations on indices will auto create it, if allowed + // we clean the metadata when loosing a cluster-manager, therefore all operations on indices will auto create it, if allowed try { builder.get(); fail("expected ClusterBlockException or MasterNotDiscoveredException"); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java index e72ce5d85303d..1bc94de1b51e1 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java @@ -72,11 +72,11 @@ public void testSimpleOnlyMasterNodeElection() throws IOException { .getMasterNodeId(), nullValue() ); - fail("should not be able to find master"); + fail("should not be able to find cluster-manager"); } catch (MasterNotDiscoveredException e) { // all is well, no cluster-manager elected } - logger.info("--> start master node"); + logger.info("--> start cluster-manager node"); final String masterNodeName = internalCluster().startClusterManagerOnlyNode(); assertThat( internalCluster().nonMasterClient() @@ -122,12 +122,12 @@ public void testSimpleOnlyMasterNodeElection() throws IOException { .getMasterNodeId(), nullValue() ); - fail("should not be able to find master"); + fail("should not be able to find cluster-manager"); } catch (MasterNotDiscoveredException e) { // all is well, no cluster-manager elected } - logger.info("--> start previous master node again"); + logger.info("--> start previous cluster-manager node again"); final String nextMasterEligibleNodeName = internalCluster().startNode( Settings.builder().put(nonDataNode(masterNode())).put(masterDataPathSettings) ); @@ -161,7 +161,7 @@ public void testSimpleOnlyMasterNodeElection() throws IOException { public void testElectOnlyBetweenMasterNodes() throws Exception { internalCluster().setBootstrapClusterManagerNodeIndex(0); - logger.info("--> start data node / non master node"); + logger.info("--> start data node / non cluster-manager node"); internalCluster().startNode(Settings.builder().put(dataOnlyNode()).put("discovery.initial_state_timeout", "1s")); try { assertThat( @@ -176,11 +176,11 @@ public void testElectOnlyBetweenMasterNodes() throws Exception { .getMasterNodeId(), nullValue() ); - fail("should not be able to find master"); + fail("should not be able to find cluster-manager"); } catch (MasterNotDiscoveredException e) { // all is well, no cluster-manager elected } - logger.info("--> start master node (1)"); + logger.info("--> start cluster-manager node (1)"); final String masterNodeName = internalCluster().startClusterManagerOnlyNode(); assertThat( internalCluster().nonMasterClient() @@ -209,7 +209,7 @@ public void testElectOnlyBetweenMasterNodes() throws Exception { equalTo(masterNodeName) ); - logger.info("--> start master node (2)"); + logger.info("--> start cluster-manager node (2)"); final String nextMasterEligableNodeName = internalCluster().startClusterManagerOnlyNode(); assertThat( internalCluster().nonMasterClient() @@ -253,7 +253,7 @@ public void testElectOnlyBetweenMasterNodes() throws Exception { logger.info("--> closing master node (1)"); client().execute(AddVotingConfigExclusionsAction.INSTANCE, new AddVotingConfigExclusionsRequest(masterNodeName)).get(); - // removing the master from the voting configuration immediately triggers the master to step down + // removing the cluster-manager from the voting configuration immediately triggers the cluster-manager to step down assertBusy(() -> { assertThat( internalCluster().nonMasterClient() @@ -313,10 +313,10 @@ public void testElectOnlyBetweenMasterNodes() throws Exception { public void testAliasFilterValidation() { internalCluster().setBootstrapClusterManagerNodeIndex(0); - logger.info("--> start master node / non data"); + logger.info("--> start cluster-manager node / non data"); internalCluster().startClusterManagerOnlyNode(); - logger.info("--> start data node / non master node"); + logger.info("--> start data node / non cluster-manager node"); internalCluster().startDataOnlyNode(); assertAcked( diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/action/shard/ShardStateActionIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/action/shard/ShardStateActionIT.java index dc1814c132d96..a5c35f3e25f09 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/action/shard/ShardStateActionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/action/shard/ShardStateActionIT.java @@ -119,7 +119,7 @@ public void testFollowupRerouteCanBeSetToHigherPriority() { .setPersistentSettings(Settings.builder().put(ShardStateAction.FOLLOW_UP_REROUTE_PRIORITY_SETTING.getKey(), "urgent")) ); - // ensure that the master always has a HIGH priority pending task + // ensure that the cluster-manager always has a HIGH priority pending task final AtomicBoolean stopSpammingMaster = new AtomicBoolean(); final ClusterService masterClusterService = internalCluster().getInstance(ClusterService.class, internalCluster().getMasterName()); masterClusterService.submitStateUpdateTask("spam", new ClusterStateUpdateTask(Priority.HIGH) { @@ -141,7 +141,8 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS } }); - // even with the master under such pressure, all shards of the index can be assigned; in particular, after the primaries have + // even with the cluster-manager under such pressure, all shards of the index can be assigned; in particular, after the primaries + // have // started there's a follow-up reroute at a higher priority than the spam createIndex("test"); assertFalse(client().admin().cluster().prepareHealth().setWaitForGreenStatus().get().isTimedOut()); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/RareClusterStateIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/RareClusterStateIT.java index 2e0ff9aeb5956..1b361b8051416 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/RareClusterStateIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/RareClusterStateIT.java @@ -105,9 +105,9 @@ public void testAssignmentWithJustAddedNodes() { // close to have some unassigned started shards shards.. client().admin().indices().prepareClose(index).get(); - final String masterName = internalCluster().getMasterName(); - final ClusterService clusterService = internalCluster().clusterService(masterName); - final AllocationService allocationService = internalCluster().getInstance(AllocationService.class, masterName); + final String clusterManagerName = internalCluster().getMasterName(); + final ClusterService clusterService = internalCluster().clusterService(clusterManagerName); + final AllocationService allocationService = internalCluster().getInstance(AllocationService.class, clusterManagerName); clusterService.submitStateUpdateTask("test-inject-node-and-reroute", new ClusterStateUpdateTask() { @Override public ClusterState execute(ClusterState currentState) { @@ -220,36 +220,36 @@ public void testDelayedMappingPropagationOnPrimary() throws Exception { final List nodeNames = internalCluster().startNodes(2); assertFalse(client().admin().cluster().prepareHealth().setWaitForNodes("2").get().isTimedOut()); - final String master = internalCluster().getMasterName(); - assertThat(nodeNames, hasItem(master)); + final String clusterManager = internalCluster().getMasterName(); + assertThat(nodeNames, hasItem(clusterManager)); String otherNode = null; for (String node : nodeNames) { - if (node.equals(master) == false) { + if (node.equals(clusterManager) == false) { otherNode = node; break; } } assertNotNull(otherNode); - // Don't allocate the shard on the master node + // Don't allocate the shard on the cluster-manager node assertAcked( prepareCreate("index").setSettings( Settings.builder() .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) - .put("index.routing.allocation.exclude._name", master) + .put("index.routing.allocation.exclude._name", clusterManager) ).get() ); ensureGreen(); // Check routing tables ClusterState state = client().admin().cluster().prepareState().get().getState(); - assertEquals(master, state.nodes().getMasterNode().getName()); + assertEquals(clusterManager, state.nodes().getMasterNode().getName()); List shards = state.routingTable().allShards("index"); assertThat(shards, hasSize(1)); for (ShardRouting shard : shards) { if (shard.primary()) { - // primary must not be on the master node + // primary must not be on the cluster-manager node assertFalse(state.nodes().getMasterNodeId().equals(shard.currentNodeId())); } else { fail(); // only primaries @@ -266,7 +266,7 @@ public void testDelayedMappingPropagationOnPrimary() throws Exception { client().admin().indices().preparePutMapping("index").setSource("field", "type=long") ); - // ...and wait for mappings to be available on master + // ...and wait for mappings to be available on cluster-manager assertBusy(() -> { MappingMetadata typeMappings = client().admin().indices().prepareGetMappings("index").get().getMappings().get("index"); assertNotNull(typeMappings); @@ -308,24 +308,24 @@ public void testDelayedMappingPropagationOnReplica() throws Exception { final List nodeNames = internalCluster().startNodes(2); assertFalse(client().admin().cluster().prepareHealth().setWaitForNodes("2").get().isTimedOut()); - final String master = internalCluster().getMasterName(); - assertThat(nodeNames, hasItem(master)); + final String clusterManager = internalCluster().getMasterName(); + assertThat(nodeNames, hasItem(clusterManager)); String otherNode = null; for (String node : nodeNames) { - if (node.equals(master) == false) { + if (node.equals(clusterManager) == false) { otherNode = node; break; } } assertNotNull(otherNode); - // Force allocation of the primary on the master node by first only allocating on the master + // Force allocation of the primary on the cluster-manager node by first only allocating on the cluster-manager // and then allowing all nodes so that the replica gets allocated on the other node prepareCreate("index").setSettings( Settings.builder() .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 1) - .put("index.routing.allocation.include._name", master) + .put("index.routing.allocation.include._name", clusterManager) ).get(); client().admin() .indices() @@ -336,7 +336,7 @@ public void testDelayedMappingPropagationOnReplica() throws Exception { // Check routing tables ClusterState state = client().admin().cluster().prepareState().get().getState(); - assertEquals(master, state.nodes().getMasterNode().getName()); + assertEquals(clusterManager, state.nodes().getMasterNode().getName()); List shards = state.routingTable().allShards("index"); assertThat(shards, hasSize(2)); for (ShardRouting shard : shards) { @@ -359,7 +359,7 @@ public void testDelayedMappingPropagationOnReplica() throws Exception { final Index index = resolveIndex("index"); // Wait for mappings to be available on master assertBusy(() -> { - final IndicesService indicesService = internalCluster().getInstance(IndicesService.class, master); + final IndicesService indicesService = internalCluster().getInstance(IndicesService.class, clusterManager); final IndexService indexService = indicesService.indexServiceSafe(index); assertNotNull(indexService); final MapperService mapperService = indexService.mapperService(); @@ -383,7 +383,7 @@ public void testDelayedMappingPropagationOnReplica() throws Exception { // ...and wait for second mapping to be available on master assertBusy(() -> { - final IndicesService indicesService = internalCluster().getInstance(IndicesService.class, master); + final IndicesService indicesService = internalCluster().getInstance(IndicesService.class, clusterManager); final IndexService indexService = indicesService.indexServiceSafe(index); assertNotNull(indexService); final MapperService mapperService = indexService.mapperService(); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java index 7b0ffa0ceea32..a57ea705f4f88 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java @@ -135,7 +135,7 @@ public void testFailedRecoveryOnAllocateStalePrimaryRequiresAnotherAllocateStale // create fake corrupted marker on node1 putFakeCorruptionMarker(indexSettings, shardId, indexPath); - // thanks to master node1 is out of sync + // thanks to cluster-manager node1 is out of sync node1 = internalCluster().startNode(node1DataPathSettings); // there is only _stale_ primary diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/PrimaryAllocationIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/PrimaryAllocationIT.java index 00e603e196a0c..29b18825c4fce 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/PrimaryAllocationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/PrimaryAllocationIT.java @@ -149,7 +149,7 @@ public void testBulkWeirdScenario() throws Exception { } // returns data paths settings of in-sync shard copy - private Settings createStaleReplicaScenario(String master) throws Exception { + private Settings createStaleReplicaScenario(String clusterManager) throws Exception { client().prepareIndex("test").setSource(jsonBuilder().startObject().field("field", "value1").endObject()).get(); refresh(); ClusterState state = client().admin().cluster().prepareState().all().get().getState(); @@ -167,14 +167,14 @@ private Settings createStaleReplicaScenario(String master) throws Exception { } NetworkDisruption partition = new NetworkDisruption( - new TwoPartitions(Sets.newHashSet(master, replicaNode), Collections.singleton(primaryNode)), + new TwoPartitions(Sets.newHashSet(clusterManager, replicaNode), Collections.singleton(primaryNode)), NetworkDisruption.DISCONNECT ); internalCluster().setDisruptionScheme(partition); logger.info("--> partitioning node with primary shard from rest of cluster"); partition.startDisrupting(); - ensureStableCluster(2, master); + ensureStableCluster(2, clusterManager); logger.info("--> index a document into previous replica shard (that is now primary)"); client(replicaNode).prepareIndex("test").setSource(jsonBuilder().startObject().field("field", "value1").endObject()).get(); @@ -183,26 +183,29 @@ private Settings createStaleReplicaScenario(String master) throws Exception { final Settings inSyncDataPathSettings = internalCluster().dataPathSettings(replicaNode); internalCluster().stopRandomNode(InternalTestCluster.nameFilter(replicaNode)); - ensureStableCluster(1, master); + ensureStableCluster(1, clusterManager); partition.stopDisrupting(); logger.info("--> waiting for node with old primary shard to rejoin the cluster"); - ensureStableCluster(2, master); + ensureStableCluster(2, clusterManager); logger.info("--> check that old primary shard does not get promoted to primary again"); // kick reroute and wait for all shard states to be fetched - client(master).admin().cluster().prepareReroute().get(); + client(clusterManager).admin().cluster().prepareReroute().get(); assertBusy( - () -> assertThat(internalCluster().getInstance(GatewayAllocator.class, master).getNumberOfInFlightFetches(), equalTo(0)) + () -> assertThat(internalCluster().getInstance(GatewayAllocator.class, clusterManager).getNumberOfInFlightFetches(), equalTo(0)) ); // kick reroute a second time and check that all shards are unassigned - assertThat(client(master).admin().cluster().prepareReroute().get().getState().getRoutingNodes().unassigned().size(), equalTo(2)); + assertThat( + client(clusterManager).admin().cluster().prepareReroute().get().getState().getRoutingNodes().unassigned().size(), + equalTo(2) + ); return inSyncDataPathSettings; } public void testDoNotAllowStaleReplicasToBePromotedToPrimary() throws Exception { - logger.info("--> starting 3 nodes, 1 master, 2 data"); + logger.info("--> starting 3 nodes, 1 cluster-manager, 2 data"); String master = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNodes(2); assertAcked( diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java index 2fe7efdf8fc3a..b5d260f5c3314 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java @@ -353,7 +353,7 @@ private void refreshDiskUsage() { private void assertBusyWithDiskUsageRefresh(String nodeName, String indexName, Matcher> matcher) throws Exception { assertBusy(() -> { - // refresh the master's ClusterInfoService before checking the assigned shards because DiskThresholdMonitor might still + // refresh the cluster-manager's ClusterInfoService before checking the assigned shards because DiskThresholdMonitor might still // be processing a previous ClusterInfo update and will skip the new one (see DiskThresholdMonitor#onNewInfo(ClusterInfo) // and its internal checkInProgress flag) refreshDiskUsage(); diff --git a/server/src/internalClusterTest/java/org/opensearch/env/NodeEnvironmentIT.java b/server/src/internalClusterTest/java/org/opensearch/env/NodeEnvironmentIT.java index 83c103bd82738..8eecf001da103 100644 --- a/server/src/internalClusterTest/java/org/opensearch/env/NodeEnvironmentIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/env/NodeEnvironmentIT.java @@ -79,10 +79,10 @@ public void testStartFailureOnDataForNonDataNode() throws Exception { ); } - logger.info("--> restarting the node without the data and master roles"); + logger.info("--> restarting the node without the data and cluster-manager roles"); IllegalStateException ex = expectThrows( IllegalStateException.class, - "node not having the data and master roles while having existing index metadata must fail", + "node not having the data and cluster-manager roles while having existing index metadata must fail", () -> internalCluster().restartRandomDataNode(new InternalTestCluster.RestartCallback() { @Override public Settings onNodeStopped(String nodeName) { diff --git a/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java b/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java index 11ece43ea90d7..7a5c7ac653ab4 100644 --- a/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java @@ -121,8 +121,8 @@ public void testRepurpose() throws Exception { executeRepurposeCommand(noClusterManagerNoDataSettingsForClusterManagerNode, 1, 0); - // by restarting as master and data node, we can check that the index definition was really deleted and also that the tool - // does not mess things up so much that the nodes cannot boot as master or data node any longer. + // by restarting as cluster-manager and data node, we can check that the index definition was really deleted and also that the tool + // does not mess things up so much that the nodes cannot boot as cluster-manager or data node any longer. internalCluster().startClusterManagerOnlyNode(clusterManagerNodeDataPathSettings); internalCluster().startDataOnlyNode(dataNodeDataPathSettings); diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/GatewayIndexStateIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/GatewayIndexStateIT.java index 1542d6800eaa1..017865a1397e8 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/GatewayIndexStateIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/GatewayIndexStateIT.java @@ -241,16 +241,16 @@ public void testSimpleOpenClose() throws Exception { client().prepareIndex("test").setId("2").setSource("field1", "value1").execute().actionGet(); } - public void testJustMasterNode() throws Exception { + public void testJustClusterManagerNode() throws Exception { logger.info("--> cleaning nodes"); - logger.info("--> starting 1 master node non data"); + logger.info("--> starting 1 cluster-manager node non data"); internalCluster().startNode(nonDataNode()); logger.info("--> create an index"); client().admin().indices().prepareCreate("test").setWaitForActiveShards(ActiveShardCount.NONE).execute().actionGet(); - logger.info("--> restarting master node"); + logger.info("--> restarting cluster-manager node"); internalCluster().fullRestart(new RestartCallback() { @Override public Settings onNodeStopped(String nodeName) { @@ -273,10 +273,10 @@ public Settings onNodeStopped(String nodeName) { assertThat(clusterStateResponse.getState().metadata().hasIndex("test"), equalTo(true)); } - public void testJustMasterNodeAndJustDataNode() { + public void testJustClusterManagerNodeAndJustDataNode() { logger.info("--> cleaning nodes"); - logger.info("--> starting 1 master node non data"); + logger.info("--> starting 1 cluster-manager node non data"); internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoverAfterNodesIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoverAfterNodesIT.java index 77a9d37063c83..bda0ca82a741c 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoverAfterNodesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoverAfterNodesIT.java @@ -129,7 +129,7 @@ public void testRecoverAfterNodes() throws Exception { public void testRecoverAfterMasterNodes() throws Exception { internalCluster().setBootstrapClusterManagerNodeIndex(0); - logger.info("--> start master_node (1)"); + logger.info("--> start cluster_manager_node (1)"); Client master1 = startNode(Settings.builder().put("gateway.recover_after_master_nodes", 2).put(clusterManagerOnlyNode())); assertThat( master1.admin() @@ -210,7 +210,7 @@ public void testRecoverAfterMasterNodes() throws Exception { hasItem(GatewayService.STATE_NOT_RECOVERED_BLOCK) ); - logger.info("--> start master_node (2)"); + logger.info("--> start cluster_manager_node (2)"); Client master2 = startNode(Settings.builder().put("gateway.recover_after_master_nodes", 2).put(clusterManagerOnlyNode())); assertThat(waitForNoBlocksOnNode(BLOCK_WAIT_TIMEOUT, master1).isEmpty(), equalTo(true)); assertThat(waitForNoBlocksOnNode(BLOCK_WAIT_TIMEOUT, master2).isEmpty(), equalTo(true)); @@ -220,7 +220,7 @@ public void testRecoverAfterMasterNodes() throws Exception { public void testRecoverAfterDataNodes() throws Exception { internalCluster().setBootstrapClusterManagerNodeIndex(0); - logger.info("--> start master_node (1)"); + logger.info("--> start cluster_manager_node (1)"); Client master1 = startNode(Settings.builder().put("gateway.recover_after_data_nodes", 2).put(clusterManagerOnlyNode())); assertThat( master1.admin() @@ -262,7 +262,7 @@ public void testRecoverAfterDataNodes() throws Exception { hasItem(GatewayService.STATE_NOT_RECOVERED_BLOCK) ); - logger.info("--> start master_node (2)"); + logger.info("--> start cluster_manager_node (2)"); Client master2 = startNode(Settings.builder().put("gateway.recover_after_data_nodes", 2).put(clusterManagerOnlyNode())); assertThat( master2.admin() diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java index 79ffe12d13129..11af1fb3cbfab 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java @@ -445,7 +445,7 @@ public void testLatestVersionLoaded() throws Exception { .setSource(jsonBuilder().startObject().field("field", "value3").endObject()) .execute() .actionGet(); - // TODO: remove once refresh doesn't fail immediately if there a master block: + // TODO: remove once refresh doesn't fail immediately if there a cluster-manager block: // https://github.com/elastic/elasticsearch/issues/9997 // client().admin().cluster().prepareHealth("test").setWaitForYellowStatus().get(); logger.info("--> refreshing all indices after indexing is complete"); @@ -665,7 +665,7 @@ public void assertSyncIdsNotNull() { } public void testStartedShardFoundIfStateNotYetProcessed() throws Exception { - // nodes may need to report the shards they processed the initial recovered cluster state from the master + // nodes may need to report the shards they processed the initial recovered cluster state from the cluster-manager final String nodeName = internalCluster().startNode(); createIndex("test", Settings.builder().put(SETTING_NUMBER_OF_SHARDS, 1).build()); final String customDataPath = IndexMetadata.INDEX_DATA_PATH_SETTING.get( diff --git a/server/src/internalClusterTest/java/org/opensearch/index/mapper/DynamicMappingIT.java b/server/src/internalClusterTest/java/org/opensearch/index/mapper/DynamicMappingIT.java index d5924155e2ec7..df208651f9c80 100644 --- a/server/src/internalClusterTest/java/org/opensearch/index/mapper/DynamicMappingIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/index/mapper/DynamicMappingIT.java @@ -76,7 +76,7 @@ public void testConflictingDynamicMappings() { assertThat(e.getMessage(), Matchers.containsString("failed to parse field [foo] of type [long]")); } catch (IllegalArgumentException e) { // rare case: the node that processes the index request doesn't have the mappings - // yet and sends a mapping update to the master node to map "bar" as "text". This + // yet and sends a mapping update to the cluster-manager node to map "bar" as "text". This // fails as it had been already mapped as a long by the previous index request. assertThat(e.getMessage(), Matchers.containsString("mapper [foo] cannot be changed from type [long] to [text]")); } diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/mapping/UpdateMappingIntegrationIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/mapping/UpdateMappingIntegrationIT.java index 0a29794add5a8..8e2872f31abfc 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/mapping/UpdateMappingIntegrationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/mapping/UpdateMappingIntegrationIT.java @@ -390,7 +390,7 @@ private void assertConcreteMappingsOnAll(final String index, final String... fie } /** - * Waits for the given mapping type to exists on the master node. + * Waits for the given mapping type to exists on the cluster-manager node. */ private void assertMappingOnMaster(final String index, final String... fieldNames) { GetMappingsResponse response = client().admin().indices().prepareGetMappings(index).get(); diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/state/CloseWhileRelocatingShardsIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/state/CloseWhileRelocatingShardsIT.java index caf741e9b8882..3d70622e122c0 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/state/CloseWhileRelocatingShardsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/state/CloseWhileRelocatingShardsIT.java @@ -147,7 +147,7 @@ public void testCloseWhileRelocatingShards() throws Exception { ); final String targetNode = internalCluster().startDataOnlyNode(); - ensureClusterSizeConsistency(); // wait for the master to finish processing join. + ensureClusterSizeConsistency(); // wait for the cluster-manager to finish processing join. try { final ClusterService clusterService = internalCluster().getInstance(ClusterService.class, internalCluster().getMasterName()); diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/store/IndicesStoreIntegrationIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/store/IndicesStoreIntegrationIT.java index 2e35b7159b6aa..79975a7d080ee 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/store/IndicesStoreIntegrationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/store/IndicesStoreIntegrationIT.java @@ -105,7 +105,7 @@ protected Collection> nodePlugins() { @Override protected void ensureClusterStateConsistency() throws IOException { - // testShardActiveElseWhere might change the state of a non-master node + // testShardActiveElseWhere might change the state of a non-cluster-manager node // so we cannot check state consistency of this cluster } diff --git a/server/src/internalClusterTest/java/org/opensearch/recovery/FullRollingRestartIT.java b/server/src/internalClusterTest/java/org/opensearch/recovery/FullRollingRestartIT.java index a8423312de271..f636185fd4649 100644 --- a/server/src/internalClusterTest/java/org/opensearch/recovery/FullRollingRestartIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/recovery/FullRollingRestartIT.java @@ -199,7 +199,7 @@ public void testNoRebalanceOnRollingRestart() throws Exception { internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNodes(3); /** - * We start 3 nodes and a dedicated master. Restart on of the data-nodes and ensure that we got no relocations. + * We start 3 nodes and a dedicated cluster-manager. Restart on of the data-nodes and ensure that we got no relocations. * Yet we have 6 shards 0 replica so that means if the restarting node comes back both other nodes are subject * to relocating to the restarting node since all had 2 shards and now one node has nothing allocated. * We have a fix for this to wait until we have allocated unallocated shards now so this shouldn't happen.