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

Replace internal usages of 'master' term in 'server/src/test' directory #2520

Merged
merged 26 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6b0ce71
Replace internal usages of 'master' terminology in server/src/test di…
Mar 19, 2022
36ebbcb
Merge branch 'main' into replace-master-int-server-test
Mar 19, 2022
63e5728
Merge branch 'main' into replace-master-int-server-test
Apr 27, 2022
47c5c0b
Merge remote-tracking branch 'upstream/main' into replace-master-int-…
May 4, 2022
a130464
Replace 'master' terminology with 'cluster manager' more classes
May 4, 2022
3747411
Replace 'master' terminology with 'cluster manager' more classes
May 4, 2022
33ebf86
Adjust format by spotlessApply task
May 4, 2022
9751c84
Replace 'master' terminology with 'cluster manager' more classes
May 4, 2022
8db5521
Replace 'master' terminology with 'cluster manager' more classes
May 4, 2022
d6dda60
Adjust format by spotlessApply task
May 5, 2022
b4953ad
Merge remote-tracking branch 'upstream/main' into replace-master-int-…
May 15, 2022
44c6122
Replace 'master' terminology with 'cluster manager' in server/src/tes…
May 15, 2022
bddb976
Replace master with cluster_manager in node filter
May 16, 2022
4f8cf38
Adjust format by spotlessApply task
May 16, 2022
a01fd4e
Rename assertDifferentMaster()
May 17, 2022
6b756ec
Replace master with cluster_manager in server/src/test
May 18, 2022
fa6e5ed
Merge remote-tracking branch 'upstream/main' into replace-master-int-…
May 18, 2022
47cfbab
Adjust format by spotlessApply task
May 18, 2022
dbb085b
Replace master with cluster_manager in assertNoMaster() in server/src…
May 18, 2022
4f71700
Resolve compile error
May 18, 2022
50fcf3b
Merge branch 'main' into replace-master-int-server-test
May 19, 2022
737843f
Replace master with cluster_manager in test method names in server/sr…
May 19, 2022
a87cede
Rename master to cluster-manager in sever/src/test
May 24, 2022
37a0b17
Replace master with cluster_manager in test method names in server/sr…
May 25, 2022
51d5007
Merge branch 'main' into replace-master-int-server-test
May 25, 2022
704f00c
Replace NoMasterBlock with NoClusterManagerBlock in test method names…
May 25, 2022
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
Prev Previous commit
Next Next commit
Replace master with cluster_manager in test method names in server/sr…
…c/internalClusterTest

Signed-off-by: Tianli Feng <ftianli@amazon.com>
  • Loading branch information
Tianli Feng committed May 19, 2022
commit 737843fcc447c4e9167edc1e24a7ed59c043241c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public void testWithdrawsVotesFromNodesMatchingWildcard() throws InterruptedExce
assertWarnings(AddVotingConfigExclusionsRequest.DEPRECATION_MESSAGE);
}

public void testWithdrawsVotesFromAllMasterEligibleNodes() throws InterruptedException {
public void testWithdrawsVotesFromAllClusterManagerEligibleNodes() throws InterruptedException {
final CountDownLatch countDownLatch = new CountDownLatch(2);

clusterStateObserver.waitForNextChange(new AdjustConfigurationForExclusions(countDownLatch));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void testSupersedes() {
.version(randomInt(5))
.nodes(DiscoveryNodes.builder(nodes).masterNodeId(node1.getId()))
.build();
ClusterState withMaster1b = ClusterState.builder(name)
ClusterState withClusterManager1b = ClusterState.builder(name)
.version(randomInt(5))
.nodes(DiscoveryNodes.builder(nodes).masterNodeId(node1.getId()))
.build();
Expand All @@ -110,7 +110,10 @@ public void testSupersedes() {
assertFalse(withClusterManager1a.supersedes(noClusterManager1));

// state from the same cluster-manager compare by version
assertThat(withClusterManager1a.supersedes(withMaster1b), equalTo(withClusterManager1a.version() > withMaster1b.version()));
assertThat(
withClusterManager1a.supersedes(withClusterManager1b),
equalTo(withClusterManager1a.version() > withClusterManager1b.version())
);
}

public void testBuilderRejectsNullCustom() {
Expand Down Expand Up @@ -146,8 +149,8 @@ public void testToXContent() throws IOException {
+ " \"cluster_uuid\" : \"clusterUUID\",\n"
+ " \"version\" : 0,\n"
+ " \"state_uuid\" : \"stateUUID\",\n"
+ " \"master_node\" : \"masterNodeId\",\n"
+ " \"cluster_manager_node\" : \"masterNodeId\",\n"
+ " \"master_node\" : \"clusterManagerNodeId\",\n"
+ " \"cluster_manager_node\" : \"clusterManagerNodeId\",\n"
+ " \"blocks\" : {\n"
+ " \"global\" : {\n"
+ " \"1\" : {\n"
Expand Down Expand Up @@ -352,8 +355,8 @@ public void testToXContent_FlatSettingTrue_ReduceMappingFalse() throws IOExcepti
+ " \"cluster_uuid\" : \"clusterUUID\",\n"
+ " \"version\" : 0,\n"
+ " \"state_uuid\" : \"stateUUID\",\n"
+ " \"master_node\" : \"masterNodeId\",\n"
+ " \"cluster_manager_node\" : \"masterNodeId\",\n"
+ " \"master_node\" : \"clusterManagerNodeId\",\n"
+ " \"cluster_manager_node\" : \"clusterManagerNodeId\",\n"
+ " \"blocks\" : {\n"
+ " \"global\" : {\n"
+ " \"1\" : {\n"
Expand Down Expand Up @@ -551,8 +554,8 @@ public void testToXContent_FlatSettingFalse_ReduceMappingTrue() throws IOExcepti
+ " \"cluster_uuid\" : \"clusterUUID\",\n"
+ " \"version\" : 0,\n"
+ " \"state_uuid\" : \"stateUUID\",\n"
+ " \"master_node\" : \"masterNodeId\",\n"
+ " \"cluster_manager_node\" : \"masterNodeId\",\n"
+ " \"master_node\" : \"clusterManagerNodeId\",\n"
+ " \"cluster_manager_node\" : \"clusterManagerNodeId\",\n"
+ " \"blocks\" : {\n"
+ " \"global\" : {\n"
+ " \"1\" : {\n"
Expand Down Expand Up @@ -868,7 +871,7 @@ private ClusterState buildClusterState() throws IOException {
.stateUUID("stateUUID")
.nodes(
DiscoveryNodes.builder()
.masterNodeId("masterNodeId")
.masterNodeId("clusterManagerNodeId")
.add(new DiscoveryNode("nodeId1", new TransportAddress(InetAddress.getByName("127.0.0.1"), 111), Version.CURRENT))
.build()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ private static class TestShardStateAction extends ShardStateAction {

private Runnable onBeforeWaitForNewClusterManagerAndRetry;

public void setOnBeforeWaitForNewMasterAndRetry(Runnable onBeforeWaitForNewMasterAndRetry) {
this.onBeforeWaitForNewClusterManagerAndRetry = onBeforeWaitForNewMasterAndRetry;
public void setOnBeforeWaitForNewClusterManagerAndRetry(Runnable onBeforeWaitForNewClusterManagerAndRetry) {
this.onBeforeWaitForNewClusterManagerAndRetry = onBeforeWaitForNewClusterManagerAndRetry;
}

private Runnable onAfterWaitForNewClusterManagerAndRetry;

public void setOnAfterWaitForNewMasterAndRetry(Runnable onAfterWaitForNewMasterAndRetry) {
this.onAfterWaitForNewClusterManagerAndRetry = onAfterWaitForNewMasterAndRetry;
public void setOnAfterWaitFornewClusterManagerAndRetry(Runnable onAfterWaitFornewClusterManagerAndRetry) {
this.onAfterWaitForNewClusterManagerAndRetry = onAfterWaitFornewClusterManagerAndRetry;
}

@Override
Expand Down Expand Up @@ -160,8 +160,8 @@ public void setUp() throws Exception {
transportService.start();
transportService.acceptIncomingRequests();
shardStateAction = new TestShardStateAction(clusterService, transportService, null, null);
shardStateAction.setOnBeforeWaitForNewMasterAndRetry(() -> {});
shardStateAction.setOnAfterWaitForNewMasterAndRetry(() -> {});
shardStateAction.setOnBeforeWaitForNewClusterManagerAndRetry(() -> {});
shardStateAction.setOnAfterWaitFornewClusterManagerAndRetry(() -> {});
}

@Override
Expand Down Expand Up @@ -205,14 +205,14 @@ public void testSuccess() throws InterruptedException {
assertNull(listener.failure.get());
}

public void testNoMaster() throws InterruptedException {
public void testNoClusterManager() throws InterruptedException {
final String index = "test";

setState(clusterService, ClusterStateCreationUtils.stateWithActivePrimary(index, true, randomInt(5)));

DiscoveryNodes.Builder noMasterBuilder = DiscoveryNodes.builder(clusterService.state().nodes());
noMasterBuilder.masterNodeId(null);
setState(clusterService, ClusterState.builder(clusterService.state()).nodes(noMasterBuilder));
DiscoveryNodes.Builder noClusterManagerBuilder = DiscoveryNodes.builder(clusterService.state().nodes());
noClusterManagerBuilder.masterNodeId(null);
setState(clusterService, ClusterState.builder(clusterService.state()).nodes(noClusterManagerBuilder));

CountDownLatch latch = new CountDownLatch(1);
AtomicInteger retries = new AtomicInteger();
Expand Down Expand Up @@ -242,7 +242,7 @@ public void onFailure(Exception e) {
assertTrue(success.get());
}

public void testMasterChannelException() throws InterruptedException {
public void testClusterManagerChannelException() throws InterruptedException {
final String index = "test";

setState(clusterService, ClusterStateCreationUtils.stateWithActivePrimary(index, true, randomInt(5)));
Expand Down Expand Up @@ -497,13 +497,13 @@ private ShardRouting getRandomShardRouting(String index) {
}

private void setUpMasterRetryVerification(int numberOfRetries, AtomicInteger retries, CountDownLatch latch, LongConsumer retryLoop) {
shardStateAction.setOnBeforeWaitForNewMasterAndRetry(() -> {
shardStateAction.setOnBeforeWaitForNewClusterManagerAndRetry(() -> {
DiscoveryNodes.Builder clusterManagerBuilder = DiscoveryNodes.builder(clusterService.state().nodes());
clusterManagerBuilder.masterNodeId(clusterService.state().nodes().getMasterNodes().iterator().next().value.getId());
setState(clusterService, ClusterState.builder(clusterService.state()).nodes(clusterManagerBuilder));
});

shardStateAction.setOnAfterWaitForNewMasterAndRetry(() -> verifyRetry(numberOfRetries, retries, latch, retryLoop));
shardStateAction.setOnAfterWaitFornewClusterManagerAndRetry(() -> verifyRetry(numberOfRetries, retries, latch, retryLoop));
}

private void verifyRetry(int numberOfRetries, AtomicInteger retries, CountDownLatch latch, LongConsumer retryLoop) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public void testDoesNothingByDefaultIfClusterManagerNodesConfigured() {
testDoesNothingWithSettings(builder().putList(INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey()));
}

public void testDoesNothingByDefaultOnMasterIneligibleNodes() {
public void testDoesNothingByDefaultOnClusterManagerIneligibleNodes() {
localNode = new DiscoveryNode(
"local",
randomAlphaOfLength(10),
Expand Down Expand Up @@ -401,7 +401,7 @@ public void testDoesNotBootstrapIfAlreadyBootstrapped() {
deterministicTaskQueue.runAllTasks();
}

public void testDoesNotBootstrapsOnNonMasterNode() {
public void testDoesNotBootstrapsOnNonClusterManagerNode() {
localNode = new DiscoveryNode(
"local",
randomAlphaOfLength(10),
Expand Down Expand Up @@ -676,7 +676,7 @@ public void testFailBootstrapWithBothSingleNodeDiscoveryAndInitialClusterManager
);
}

public void testFailBootstrapNonMasterEligibleNodeWithSingleNodeDiscovery() {
public void testFailBootstrapNonClusterManagerEligibleNodeWithSingleNodeDiscovery() {
final Settings.Builder settings = Settings.builder()
.put(DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey(), DiscoveryModule.SINGLE_NODE_DISCOVERY_TYPE)
.put(NODE_NAME_SETTING.getKey(), localNode.getName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void testScheduling() {
assertThat(logLastFailedJoinAttemptWarningCount.get(), is(5L));
owaiskazi19 marked this conversation as resolved.
Show resolved Hide resolved
}

public void testDescriptionOnMasterIneligibleNodes() {
public void testDescriptionOnClusterManagerIneligibleNodes() {
final DiscoveryNode localNode = new DiscoveryNode("local", buildNewFakeTransportAddress(), emptyMap(), emptySet(), Version.CURRENT);
final ClusterState clusterState = ClusterState.builder(ClusterName.DEFAULT)
.version(12L)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void testCanUpdateClusterStateAfterStabilisation() {
}
}

public void testDoesNotElectNonMasterNode() {
public void testDoesNotElectNonClusterManagerNode() {
try (Cluster cluster = new Cluster(randomIntBetween(1, 5), false, Settings.EMPTY)) {
cluster.runRandomly();
cluster.stabilise();
Expand Down Expand Up @@ -1175,7 +1175,7 @@ private void testAppliesNoMasterBlock(String noMasterBlockSetting, ClusterBlock
}
}

public void testNodeCannotJoinIfJoinValidationFailsOnMaster() {
public void testNodeCannotJoinIfJoinValidationFailsOnClusterManager() {
try (Cluster cluster = new Cluster(randomIntBetween(1, 3))) {
cluster.runRandomly();
cluster.stabilise();
Expand Down Expand Up @@ -1305,7 +1305,7 @@ public void testDiscoveryUsesNodesFromLastClusterState() {
}
}

public void testFollowerRemovedIfUnableToSendRequestsToMaster() {
public void testFollowerRemovedIfUnableToSendRequestsToClusterManager() {
try (Cluster cluster = new Cluster(3)) {
cluster.runRandomly();
cluster.stabilise();
Expand Down Expand Up @@ -1679,7 +1679,7 @@ public String toString() {
}
}

public void testReconfiguresToExcludeMasterIneligibleNodesInVotingConfig() {
public void testReconfiguresToExcludeClusterManagerIneligibleNodesInVotingConfig() {
try (Cluster cluster = new Cluster(3)) {
cluster.runRandomly();
cluster.stabilise();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ public void testJoinWithHigherTermButBetterStateGetsRejected() {
assertFalse(isLocalNodeElectedMaster());
}

public void testJoinWithHigherTermButBetterStateStillElectsMasterThroughSelfJoin() {
public void testJoinWithHigherTermButBetterStateStillElectsClusterManagerThroughSelfJoin() {
DiscoveryNode node0 = newNode(0, true);
DiscoveryNode node1 = newNode(1, true);
long initialTerm = randomLongBetween(1, 10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public void testClusterStatePublishingFailsOrTimesOutBeforeCommit() throws Inter
);
}

public void testPublishingToMastersFirst() {
public void testPublishingToClusterManagersFirst() {
VotingConfiguration singleNodeConfig = VotingConfiguration.of(n1);
initializeCluster(singleNodeConfig);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public void onFailure(String source, Exception e) {
}
}

public void testLocalNodeMasterListenerCallbacks() {
public void testLocalNodeClusterManagerListenerCallbacks() {
TimedClusterApplierService timedClusterApplierService = createTimedClusterService(false);

AtomicBoolean isClusterManager = new AtomicBoolean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private IndexMetadata createIndexMetadata(String name) {
return IndexMetadata.builder(name).settings(settings(Version.CURRENT)).numberOfShards(5).numberOfReplicas(2).build();
}

public void testGetRelevantIndicesWithUnassignedShardsOnMasterEligibleNode() {
public void testGetRelevantIndicesWithUnassignedShardsOnClusterManagerEligibleNode() {
IndexMetadata indexMetadata = createIndexMetadata("test");
Set<Index> indices = IncrementalClusterStateWriter.getRelevantIndices(clusterStateWithUnassignedIndex(indexMetadata, true));
assertThat(indices.size(), equalTo(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public void testMissingInSyncIdsPreventAdvance() {
assertThat(updatedGlobalCheckpoint.get(), not(equalTo(UNASSIGNED_SEQ_NO)));
}

public void testInSyncIdsAreIgnoredIfNotValidatedByMaster() {
public void testInSyncIdsAreIgnoredIfNotValidatedByClusterManager() {
final Map<AllocationId, Long> active = randomAllocationsWithLocalCheckpoints(1, 5);
final Map<AllocationId, Long> initializing = randomAllocationsWithLocalCheckpoints(1, 5);
final Map<AllocationId, Long> nonApproved = randomAllocationsWithLocalCheckpoints(1, 5);
Expand All @@ -313,7 +313,7 @@ public void testInSyncIdsAreIgnoredIfNotValidatedByMaster() {
assertThat(tracker.getGlobalCheckpoint(), not(equalTo(UNASSIGNED_SEQ_NO)));
}

public void testInSyncIdsAreRemovedIfNotValidatedByMaster() {
public void testInSyncIdsAreRemovedIfNotValidatedByClusterManager() {
final long initialClusterStateVersion = randomNonNegativeLong();
final Map<AllocationId, Long> activeToStay = randomAllocationsWithLocalCheckpoints(1, 5);
final Map<AllocationId, Long> initializingToStay = randomAllocationsWithLocalCheckpoints(1, 5);
Expand Down Expand Up @@ -492,7 +492,7 @@ public void testWaitForAllocationIdToBeInSyncCanBeInterrupted() throws BrokenBar
thread.join();
}

public void testUpdateAllocationIdsFromMaster() throws Exception {
public void testUpdateAllocationIdsFromClusterManager() throws Exception {
final long initialClusterStateVersion = randomNonNegativeLong();
final int numberOfActiveAllocationsIds = randomIntBetween(2, 16);
final int numberOfInitializingIds = randomIntBetween(2, 16);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public IndexShardSnapshotStatus getShardSnapshotStatus(SnapshotId snapshotId, In
assertThat("Expecting all snapshot shard size fetches to execute a Reroute", reroutes.get(), equalTo(maxShardsToCreate));
}

public void testNoLongerMaster() throws Exception {
public void testNoLongerClusterManager() throws Exception {
final InternalSnapshotsInfoService snapshotsInfoService = new InternalSnapshotsInfoService(
Settings.EMPTY,
clusterService,
Expand Down