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 2 commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ public void testClusterHealth() throws IOException {
assertThat(clusterHealth.getActiveShardsPercent(), is(allOf(greaterThanOrEqualTo(0.0), lessThanOrEqualTo(100.0))));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discovered_master -> discovered_cluster_manager here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will address it in separate PR, and will paste the link later. discovered_master is still a existing field in cluster health API, so it will not be renamed directly. I will add additional tests for it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created new PR #3432 to rename discovered_master in the unit test.

}

public void testClusterHealthVerifyMasterNodeDiscovery() throws IOException {
public void testClusterHealthVerifyClusterManagerNodeDiscovery() throws IOException {
DiscoveryNode localNode = new DiscoveryNode("node", OpenSearchTestCase.buildNewFakeTransportAddress(), Version.CURRENT);
// set the node information to verify master_node discovery in ClusterHealthResponse
// set the node information to verify cluster_manager_node discovery in ClusterHealthResponse
ClusterState clusterState = ClusterState.builder(ClusterName.CLUSTER_NAME_SETTING.getDefault(Settings.EMPTY))
.nodes(DiscoveryNodes.builder().add(localNode).localNodeId(localNode.getId()).masterNodeId(localNode.getId()))
owaiskazi19 marked this conversation as resolved.
Show resolved Hide resolved
.build();
Expand Down Expand Up @@ -150,7 +150,7 @@ private void assertClusterHealth(ClusterHealthResponse clusterHealth) {
}

public void testVersionCompatibleSerialization() throws IOException {
boolean hasDiscoveredMaster = false;
boolean hasDiscoveredClusterManager = false;
int indicesSize = randomInt(20);
Map<String, ClusterIndexHealth> indices = new HashMap<>(indicesSize);
if ("indices".equals(level) || "shards".equals(level)) {
Expand All @@ -167,12 +167,12 @@ public void testVersionCompatibleSerialization() throws IOException {
randomInt(100),
randomInt(100),
randomInt(100),
hasDiscoveredMaster,
hasDiscoveredClusterManager,
randomDoubleBetween(0d, 100d, true),
randomFrom(ClusterHealthStatus.values()),
indices
);
// Create the Cluster Health Response object with discovered master as false,
// Create the Cluster Health Response object with discovered cluster manager as false,
// to verify serialization puts default value for the field
ClusterHealthResponse clusterHealth = new ClusterHealthResponse(
"test-cluster",
Expand Down Expand Up @@ -209,7 +209,7 @@ public void testVersionCompatibleSerialization() throws IOException {
StreamInput in_gt_7_0 = out_gt_1_0.bytes().streamInput();
Copy link
Member

@owaiskazi19 owaiskazi19 Mar 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change the text of the comments above from discovered_master to discovered_cluster_manager?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes; lets get the comments as we catch them in the PR review

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @owaiskazi19 Thanks a lot for your review! You are so careful. 😄 I will modify those discovered_master names, after checking the behavior for the API response field.

in_gt_7_0.setVersion(new_version);
clusterHealth = ClusterHealthResponse.readResponseFrom(in_gt_7_0);
assertThat(clusterHealth.hasDiscoveredMaster(), Matchers.equalTo(hasDiscoveredMaster));
assertThat(clusterHealth.hasDiscoveredMaster(), Matchers.equalTo(hasDiscoveredClusterManager));
}

ClusterHealthResponse maybeSerialize(ClusterHealthResponse clusterHealth) throws IOException {
Expand All @@ -222,7 +222,7 @@ ClusterHealthResponse maybeSerialize(ClusterHealthResponse clusterHealth) throws
return clusterHealth;
}

public void testParseFromXContentWithDiscoveredMasterField() throws IOException {
public void testParseFromXContentWithDiscoveredClusterManagerField() throws IOException {
try (
XContentParser parser = JsonXContent.jsonXContent.createParser(
NamedXContentRegistry.EMPTY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,12 +474,12 @@ public void onFailure(Exception e) {
for (int i = 1; i < testNodes.length; i++) {
discoveryNodes[i - 1] = testNodes[i].discoveryNode();
}
DiscoveryNode master = discoveryNodes[0];
DiscoveryNode clusterManager = discoveryNodes[0];
for (int i = 1; i < testNodes.length; i++) {
// Notify only nodes that should remain in the cluster
setState(
testNodes[i].clusterService,
ClusterStateCreationUtils.state(testNodes[i].discoveryNode(), master, discoveryNodes)
ClusterStateCreationUtils.state(testNodes[i].discoveryNode(), clusterManager, discoveryNodes)
);
}
if (randomBoolean()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ public static void connectNodes(TestNode... nodes) {
for (int i = 0; i < nodes.length; i++) {
discoveryNodes[i] = nodes[i].discoveryNode();
}
DiscoveryNode master = discoveryNodes[0];
DiscoveryNode clusterManager = discoveryNodes[0];
for (TestNode node : nodes) {
setState(node.clusterService, ClusterStateCreationUtils.state(node.discoveryNode(), master, discoveryNodes));
setState(node.clusterService, ClusterStateCreationUtils.state(node.discoveryNode(), clusterManager, discoveryNodes));
}
for (TestNode nodeA : nodes) {
for (TestNode nodeB : nodes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,21 +374,21 @@ public void testRequestsAreNotSentToFailedMaster() {
Request request = new Request(new String[] { TEST_INDEX });
owaiskazi19 marked this conversation as resolved.
Show resolved Hide resolved
PlainActionFuture<Response> listener = new PlainActionFuture<>();

DiscoveryNode masterNode = clusterService.state().nodes().getMasterNode();
DiscoveryNode clusterManagerNode = clusterService.state().nodes().getMasterNode();
DiscoveryNodes.Builder builder = DiscoveryNodes.builder(clusterService.state().getNodes());
builder.remove(masterNode.getId());
builder.remove(clusterManagerNode.getId());

setState(clusterService, ClusterState.builder(clusterService.state()).nodes(builder));

action.new AsyncAction(null, request, listener).start();

Map<String, List<CapturingTransport.CapturedRequest>> capturedRequests = transport.getCapturedRequestsByTargetNodeAndClear();

// the master should not be in the list of nodes that requests were sent to
// the cluster manager should not be in the list of nodes that requests were sent to
ShardsIterator shardIt = clusterService.state().routingTable().allShards(new String[] { TEST_INDEX });
Set<String> set = new HashSet<>();
for (ShardRouting shard : shardIt) {
if (!shard.currentNodeId().equals(masterNode.getId())) {
if (!shard.currentNodeId().equals(clusterManagerNode.getId())) {
set.add(shard.currentNodeId());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,11 @@ public void testDelegateToFailingMaster() throws ExecutionException, Interrupted
boolean failsWithConnectTransportException = randomBoolean();
boolean rejoinSameMaster = failsWithConnectTransportException && randomBoolean();
owaiskazi19 marked this conversation as resolved.
Show resolved Hide resolved
Request request = new Request().masterNodeTimeout(TimeValue.timeValueSeconds(failsWithConnectTransportException ? 60 : 0));
owaiskazi19 marked this conversation as resolved.
Show resolved Hide resolved
DiscoveryNode masterNode = this.remoteNode;
DiscoveryNode clusterManagerNode = this.remoteNode;
setState(
clusterService,
// use a random base version so it can go down when simulating a restart.
ClusterState.builder(ClusterStateCreationUtils.state(localNode, masterNode, allNodes)).version(randomIntBetween(0, 10))
ClusterState.builder(ClusterStateCreationUtils.state(localNode, clusterManagerNode, allNodes)).version(randomIntBetween(0, 10))
);

PlainActionFuture<Response> listener = new PlainActionFuture<>();
Expand All @@ -439,7 +439,9 @@ public void testDelegateToFailingMaster() throws ExecutionException, Interrupted
if (rejoinSameMaster) {
owaiskazi19 marked this conversation as resolved.
Show resolved Hide resolved
transport.handleRemoteError(
capturedRequest.requestId,
randomBoolean() ? new ConnectTransportException(masterNode, "Fake error") : new NodeClosedException(masterNode)
randomBoolean()
? new ConnectTransportException(clusterManagerNode, "Fake error")
: new NodeClosedException(clusterManagerNode)
);
assertFalse(listener.isDone());
if (randomBoolean()) {
Expand All @@ -452,15 +454,19 @@ public void testDelegateToFailingMaster() throws ExecutionException, Interrupted
// reset the same state to increment a version simulating a join of an existing node
// simulating use being disconnected
final DiscoveryNodes.Builder nodesBuilder = DiscoveryNodes.builder(clusterService.state().nodes());
nodesBuilder.masterNodeId(masterNode.getId());
nodesBuilder.masterNodeId(clusterManagerNode.getId());
setState(clusterService, ClusterState.builder(clusterService.state()).nodes(nodesBuilder));
} else {
// simulate master restart followed by a state recovery - this will reset the cluster state version
final DiscoveryNodes.Builder nodesBuilder = DiscoveryNodes.builder(clusterService.state().nodes());
nodesBuilder.remove(masterNode);
masterNode = new DiscoveryNode(masterNode.getId(), masterNode.getAddress(), masterNode.getVersion());
nodesBuilder.add(masterNode);
nodesBuilder.masterNodeId(masterNode.getId());
nodesBuilder.remove(clusterManagerNode);
clusterManagerNode = new DiscoveryNode(
clusterManagerNode.getId(),
clusterManagerNode.getAddress(),
clusterManagerNode.getVersion()
);
nodesBuilder.add(clusterManagerNode);
nodesBuilder.masterNodeId(clusterManagerNode.getId());
owaiskazi19 marked this conversation as resolved.
Show resolved Hide resolved
final ClusterState.Builder builder = ClusterState.builder(clusterService.state()).nodes(nodesBuilder);
setState(clusterService, builder.version(0));
}
Expand All @@ -472,7 +478,7 @@ public void testDelegateToFailingMaster() throws ExecutionException, Interrupted
assertThat(capturedRequest.request, equalTo(request));
assertThat(capturedRequest.action, equalTo("internal:testAction"));
} else if (failsWithConnectTransportException) {
transport.handleRemoteError(capturedRequest.requestId, new ConnectTransportException(masterNode, "Fake error"));
transport.handleRemoteError(capturedRequest.requestId, new ConnectTransportException(clusterManagerNode, "Fake error"));
assertFalse(listener.isDone());
setState(clusterService, ClusterStateCreationUtils.state(localNode, localNode, allNodes));
assertTrue(listener.isDone());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ private static class TestShardStateAction extends ShardStateAction {
super(clusterService, transportService, allocationService, rerouteService, THREAD_POOL);
owaiskazi19 marked this conversation as resolved.
Show resolved Hide resolved
}

private Runnable onBeforeWaitForNewMasterAndRetry;
private Runnable onBeforeWaitForNewClusterManagerAndRetry;

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

private Runnable onAfterWaitForNewMasterAndRetry;
private Runnable onAfterWaitForNewClusterManagerAndRetry;

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

@Override
Expand All @@ -132,9 +132,9 @@ protected void waitForNewMasterAndRetry(
ActionListener<Void> listener,
Predicate<ClusterState> changePredicate
) {
onBeforeWaitForNewMasterAndRetry.run();
onBeforeWaitForNewClusterManagerAndRetry.run();
super.waitForNewMasterAndRetry(actionName, observer, request, listener, changePredicate);
onAfterWaitForNewMasterAndRetry.run();
onAfterWaitForNewClusterManagerAndRetry.run();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public void testDescriptionOnUnhealthyNodes() {
is("this node is unhealthy: unhealthy-info")
);

final DiscoveryNode masterNode = new DiscoveryNode(
final DiscoveryNode clusterManagerNode = new DiscoveryNode(
"local",
buildNewFakeTransportAddress(),
emptyMap(),
Expand All @@ -292,7 +292,7 @@ public void testDescriptionOnUnhealthyNodes() {
);
clusterState = ClusterState.builder(ClusterName.DEFAULT)
.version(12L)
.nodes(DiscoveryNodes.builder().add(masterNode).localNodeId(masterNode.getId()))
.nodes(DiscoveryNodes.builder().add(clusterManagerNode).localNodeId(clusterManagerNode.getId()))
.build();

assertThat(
Expand Down Expand Up @@ -818,8 +818,8 @@ public void testDescriptionAfterBootstrapping() {
)
);

final DiscoveryNode otherMasterNode = new DiscoveryNode("other-master", buildNewFakeTransportAddress(), Version.CURRENT);
final DiscoveryNode otherNonMasterNode = new DiscoveryNode(
final DiscoveryNode otherClusterManagerNode = new DiscoveryNode("other-master", buildNewFakeTransportAddress(), Version.CURRENT);
owaiskazi19 marked this conversation as resolved.
Show resolved Hide resolved
final DiscoveryNode otherNonClusterManagerNode = new DiscoveryNode(
"other-non-master",
buildNewFakeTransportAddress(),
emptyMap(),
Expand All @@ -833,7 +833,13 @@ public void testDescriptionAfterBootstrapping() {

String[] configNodeIds = new String[] { "n1", "n2" };
final ClusterState stateWithOtherNodes = ClusterState.builder(ClusterName.DEFAULT)
.nodes(DiscoveryNodes.builder().add(localNode).localNodeId(localNode.getId()).add(otherMasterNode).add(otherNonMasterNode))
.nodes(
DiscoveryNodes.builder()
.add(localNode)
.localNodeId(localNode.getId())
.add(otherClusterManagerNode)
.add(otherNonClusterManagerNode)
)
.metadata(
Metadata.builder()
.coordinationMetadata(
Expand Down Expand Up @@ -864,13 +870,13 @@ public void testDescriptionAfterBootstrapping() {
+ "discovery will continue using [] from hosts providers and ["
+ localNode
+ ", "
+ otherMasterNode
+ otherClusterManagerNode
+ "] from last-known cluster state; node term 0, last-accepted version 0 in term 0",

"master not discovered or elected yet, an election requires two nodes with ids [n1, n2], "
+ "have discovered [] which is not a quorum; "
+ "discovery will continue using [] from hosts providers and ["
+ otherMasterNode
+ otherClusterManagerNode
+ ", "
+ localNode
+ "] from last-known cluster state; node term 0, last-accepted version 0 in term 0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void testUpdatesNodeWithNewRoles() throws Exception {

final JoinTaskExecutor joinTaskExecutor = new JoinTaskExecutor(Settings.EMPTY, allocationService, logger, rerouteService, null);

final DiscoveryNode masterNode = new DiscoveryNode(UUIDs.base64UUID(), buildNewFakeTransportAddress(), Version.CURRENT);
final DiscoveryNode clusterManagerNode = new DiscoveryNode(UUIDs.base64UUID(), buildNewFakeTransportAddress(), Version.CURRENT);

final DiscoveryNode actualNode = new DiscoveryNode(UUIDs.base64UUID(), buildNewFakeTransportAddress(), Version.CURRENT);
final DiscoveryNode bwcNode = new DiscoveryNode(
Expand All @@ -183,7 +183,13 @@ public void testUpdatesNodeWithNewRoles() throws Exception {
actualNode.getVersion()
);
final ClusterState clusterState = ClusterState.builder(ClusterName.DEFAULT)
.nodes(DiscoveryNodes.builder().add(masterNode).localNodeId(masterNode.getId()).masterNodeId(masterNode.getId()).add(bwcNode))
.nodes(
DiscoveryNodes.builder()
.add(clusterManagerNode)
.localNodeId(clusterManagerNode.getId())
.masterNodeId(clusterManagerNode.getId())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

masterNodeId -> clusterManagerNodeId?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will rename masterNodeId() in the next phase, which is mentioned in issue #1684.

.add(bwcNode)
)
.build();

final ClusterStateTaskExecutor.ClusterTasksResult<JoinTaskExecutor.Task> result = joinTaskExecutor.execute(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@

public class NoMasterBlockServiceTests extends OpenSearchTestCase {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NoMasterBlockServiceTests -> NoClusterManagerBlockServiceTests

Copy link
Collaborator Author

@tlfeng tlfeng May 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the method name noMasterBlockService in below. For the class name, I prefer to rename it along with the name of the source class NoMasterBlockService, which will be done in the next phase. Probably it will be more readable to make the names of source class and test class consistent.


private NoMasterBlockService noMasterBlockService;
private NoMasterBlockService noClusterManagerBlockService;
private ClusterSettings clusterSettings;

private void createService(Settings settings) {
clusterSettings = new ClusterSettings(settings, BUILT_IN_CLUSTER_SETTINGS);
noMasterBlockService = new NoMasterBlockService(settings, clusterSettings);
noClusterManagerBlockService = new NoMasterBlockService(settings, clusterSettings);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NoMasterBlockService -> NoClusterManagerBlockService

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the variable name. 👍

}

private void assertDeprecatedWarningEmitted() {
Expand All @@ -61,22 +61,22 @@ private void assertDeprecatedWarningEmitted() {

public void testBlocksWritesByDefault() {
createService(Settings.EMPTY);
assertThat(noMasterBlockService.getNoMasterBlock(), sameInstance(NO_MASTER_BLOCK_WRITES));
assertThat(noClusterManagerBlockService.getNoMasterBlock(), sameInstance(NO_MASTER_BLOCK_WRITES));
owaiskazi19 marked this conversation as resolved.
Show resolved Hide resolved
}

public void testBlocksWritesIfConfiguredBySetting() {
createService(Settings.builder().put(NO_CLUSTER_MANAGER_BLOCK_SETTING.getKey(), "write").build());
assertThat(noMasterBlockService.getNoMasterBlock(), sameInstance(NO_MASTER_BLOCK_WRITES));
assertThat(noClusterManagerBlockService.getNoMasterBlock(), sameInstance(NO_MASTER_BLOCK_WRITES));
}

public void testBlocksAllIfConfiguredBySetting() {
createService(Settings.builder().put(NO_CLUSTER_MANAGER_BLOCK_SETTING.getKey(), "all").build());
assertThat(noMasterBlockService.getNoMasterBlock(), sameInstance(NO_MASTER_BLOCK_ALL));
assertThat(noClusterManagerBlockService.getNoMasterBlock(), sameInstance(NO_MASTER_BLOCK_ALL));
}

public void testBlocksMetadataWritesIfConfiguredBySetting() {
createService(Settings.builder().put(NO_CLUSTER_MANAGER_BLOCK_SETTING.getKey(), "metadata_write").build());
assertThat(noMasterBlockService.getNoMasterBlock(), sameInstance(NO_MASTER_BLOCK_METADATA_WRITES));
assertThat(noClusterManagerBlockService.getNoMasterBlock(), sameInstance(NO_MASTER_BLOCK_METADATA_WRITES));
}

public void testRejectsInvalidSetting() {
Expand All @@ -88,12 +88,12 @@ public void testRejectsInvalidSetting() {

public void testSettingCanBeUpdated() {
createService(Settings.builder().put(NO_CLUSTER_MANAGER_BLOCK_SETTING.getKey(), "all").build());
assertThat(noMasterBlockService.getNoMasterBlock(), sameInstance(NO_MASTER_BLOCK_ALL));
assertThat(noClusterManagerBlockService.getNoMasterBlock(), sameInstance(NO_MASTER_BLOCK_ALL));

clusterSettings.applySettings(Settings.builder().put(NO_CLUSTER_MANAGER_BLOCK_SETTING.getKey(), "write").build());
assertThat(noMasterBlockService.getNoMasterBlock(), sameInstance(NO_MASTER_BLOCK_WRITES));
assertThat(noClusterManagerBlockService.getNoMasterBlock(), sameInstance(NO_MASTER_BLOCK_WRITES));

clusterSettings.applySettings(Settings.builder().put(NO_CLUSTER_MANAGER_BLOCK_SETTING.getKey(), "metadata_write").build());
assertThat(noMasterBlockService.getNoMasterBlock(), sameInstance(NO_MASTER_BLOCK_METADATA_WRITES));
assertThat(noClusterManagerBlockService.getNoMasterBlock(), sameInstance(NO_MASTER_BLOCK_METADATA_WRITES));
}
}
Loading