Replace 'master' terminology with 'cluster manager' in 'qa' directory (#3330)

* Replace 'master' terminology with 'cluster manager' in 'qa' directory

Signed-off-by: Tianli Feng <ftianli@amazon.com>

* Replace master_node with cluster_manager_node in cluster.state API test

Signed-off-by: Tianli Feng <ftianli@amazon.com>
This commit is contained in:
Tianli Feng 2022-05-16 05:45:17 -07:00 committed by GitHub
parent 38fb1d9275
commit e2ad4ffbe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 19 deletions

View File

@ -659,7 +659,7 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
.put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1)
.put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1)
// if the node with the replica is the first to be restarted, while a replica is still recovering // if the node with the replica is the first to be restarted, while a replica is still recovering
// then delayed allocation will kick in. When the node comes back, the master will search for a copy // then delayed allocation will kick in. When the node comes back, the cluster-manager will search for a copy
// but the recovering copy will be seen as invalid and the cluster health won't return to GREEN // but the recovering copy will be seen as invalid and the cluster health won't return to GREEN
// before timing out // before timing out
.put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms") .put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms")

View File

@ -429,23 +429,23 @@ public class IndexingIT extends OpenSearchRestTestCase {
HttpHost.create(objectPath.evaluate("nodes." + id + ".http.publish_address")))); HttpHost.create(objectPath.evaluate("nodes." + id + ".http.publish_address"))));
} }
response = client().performRequest(new Request("GET", "_cluster/state")); response = client().performRequest(new Request("GET", "_cluster/state"));
nodes.setMasterNodeId(ObjectPath.createFromResponse(response).evaluate("master_node")); nodes.setClusterManagerNodeId(ObjectPath.createFromResponse(response).evaluate("master_node"));
return nodes; return nodes;
} }
final class Nodes extends HashMap<String, Node> { final class Nodes extends HashMap<String, Node> {
private String masterNodeId = null; private String clusterManagerNodeId = null;
public Node getMaster() { public Node getClusterManager() {
return get(masterNodeId); return get(clusterManagerNodeId);
} }
public void setMasterNodeId(String id) { public void setClusterManagerNodeId(String id) {
if (get(id) == null) { if (get(id) == null) {
throw new IllegalArgumentException("node with id [" + id + "] not found. got:" + toString()); throw new IllegalArgumentException("node with id [" + id + "] not found. got:" + toString());
} }
masterNodeId = id; clusterManagerNodeId = id;
} }
public void add(Node node) { public void add(Node node) {
@ -480,7 +480,7 @@ public class IndexingIT extends OpenSearchRestTestCase {
@Override @Override
public String toString() { public String toString() {
return "Nodes{" + return "Nodes{" +
"masterNodeId='" + masterNodeId + "'\n" + "masterNodeId='" + clusterManagerNodeId + "'\n" +
values().stream().map(Node::toString).collect(Collectors.joining("\n")) + values().stream().map(Node::toString).collect(Collectors.joining("\n")) +
'}'; '}';
} }

View File

@ -45,7 +45,7 @@ task 'remote-cluster'(type: RestIntegTestTask) {
testClusters.'remote-cluster' { testClusters.'remote-cluster' {
numberOfNodes = 2 numberOfNodes = 2
setting 'node.roles', '[data,ingest,master]' setting 'node.roles', '[data,ingest,cluster_manager]'
} }
task mixedClusterTest(type: RestIntegTestTask) { task mixedClusterTest(type: RestIntegTestTask) {

View File

@ -90,7 +90,7 @@ public class RecoveryIT extends AbstractRollingTestCase {
.put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1)
.put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1)
// if the node with the replica is the first to be restarted, while a replica is still recovering // if the node with the replica is the first to be restarted, while a replica is still recovering
// then delayed allocation will kick in. When the node comes back, the master will search for a copy // then delayed allocation will kick in. When the node comes back, the cluster-manager will search for a copy
// but the recovering copy will be seen as invalid and the cluster health won't return to GREEN // but the recovering copy will be seen as invalid and the cluster health won't return to GREEN
// before timing out // before timing out
.put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms"); .put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms");
@ -158,7 +158,7 @@ public class RecoveryIT extends AbstractRollingTestCase {
.put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1)
.put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 2) .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 2)
// if the node with the replica is the first to be restarted, while a replica is still recovering // if the node with the replica is the first to be restarted, while a replica is still recovering
// then delayed allocation will kick in. When the node comes back, the master will search for a copy // then delayed allocation will kick in. When the node comes back, the cluster-manager will search for a copy
// but the recovering copy will be seen as invalid and the cluster health won't return to GREEN // but the recovering copy will be seen as invalid and the cluster health won't return to GREEN
// before timing out // before timing out
.put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms") .put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms")
@ -256,7 +256,7 @@ public class RecoveryIT extends AbstractRollingTestCase {
.put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1)
.put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 2) .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 2)
// if the node with the replica is the first to be restarted, while a replica is still recovering // if the node with the replica is the first to be restarted, while a replica is still recovering
// then delayed allocation will kick in. When the node comes back, the master will search for a copy // then delayed allocation will kick in. When the node comes back, the cluster-manager will search for a copy
// but the recovering copy will be seen as invalid and the cluster health won't return to GREEN // but the recovering copy will be seen as invalid and the cluster health won't return to GREEN
// before timing out // before timing out
.put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms") .put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms")
@ -266,7 +266,7 @@ public class RecoveryIT extends AbstractRollingTestCase {
indexDocs(index, 0, 10); indexDocs(index, 0, 10);
ensureGreen(index); ensureGreen(index);
// make sure that no shards are allocated, so we can make sure the primary stays on the old node (when one // make sure that no shards are allocated, so we can make sure the primary stays on the old node (when one
// node stops, we lose the master too, so a replica will not be promoted) // node stops, we lose the cluster-manager too, so a replica will not be promoted)
updateIndexSettings(index, Settings.builder().put(INDEX_ROUTING_ALLOCATION_ENABLE_SETTING.getKey(), "none")); updateIndexSettings(index, Settings.builder().put(INDEX_ROUTING_ALLOCATION_ENABLE_SETTING.getKey(), "none"));
break; break;
case MIXED: case MIXED:
@ -330,7 +330,7 @@ public class RecoveryIT extends AbstractRollingTestCase {
.put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1)
.put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1)
// if the node with the replica is the first to be restarted, while a replica is still recovering // if the node with the replica is the first to be restarted, while a replica is still recovering
// then delayed allocation will kick in. When the node comes back, the master will search for a copy // then delayed allocation will kick in. When the node comes back, the cluster-manager will search for a copy
// but the recovering copy will be seen as invalid and the cluster health won't return to GREEN // but the recovering copy will be seen as invalid and the cluster health won't return to GREEN
// before timing out // before timing out
.put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms") .put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms")
@ -448,7 +448,7 @@ public class RecoveryIT extends AbstractRollingTestCase {
.put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1)
.put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1) .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1)
// if the node with the replica is the first to be restarted, while a replica is still recovering // if the node with the replica is the first to be restarted, while a replica is still recovering
// then delayed allocation will kick in. When the node comes back, the master will search for a copy // then delayed allocation will kick in. When the node comes back, the cluster-manager will search for a copy
// but the recovering copy will be seen as invalid and the cluster health won't return to GREEN // but the recovering copy will be seen as invalid and the cluster health won't return to GREEN
// before timing out // before timing out
.put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms") .put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms")

View File

@ -38,5 +38,5 @@ dependencies {
} }
testClusters.integTest { testClusters.integTest {
setting 'node.roles', '[data,master,remote_cluster_client]' setting 'node.roles', '[data,cluster_manager,remote_cluster_client]'
} }

View File

@ -4,10 +4,10 @@
- do: - do:
cluster.state: {} cluster.state: {}
# Get master node id # Get cluster-manager node id
- set: { master_node: master } - set: { cluster_manager_node: cluster_manager }
- do: - do:
nodes.info: {} nodes.info: {}
- length: { nodes.$master.plugins: ${expected.plugins.count} } - length: { nodes.$cluster_manager.plugins: ${expected.plugins.count} }