Skip to content

Commit e119ac6

Browse files
authored
Move data tier roles to server (#71084)
This commit moves the data tier roles to server. It is no longer necessary to separate these roles from server as we no longer build distributions that would not contain these roles. Moving these roles will simplify many things. This is deliberately the smallest possible commit that moves these roles. Other aspects related to the data tiers can move in separate, also small, commits.
1 parent e023dca commit e119ac6

File tree

69 files changed

+335
-318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+335
-318
lines changed

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.info/10_basic.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ setup:
2626
- is_true: nodes.$node_id.roles
2727
# the roles output is sorted
2828
- match: { nodes.$node_id.roles.0: "data" }
29-
- match: { nodes.$node_id.roles.1: "ingest" }
30-
- match: { nodes.$node_id.roles.2: "master" }
31-
- match: { nodes.$node_id.roles.3: "remote_cluster_client" }
32-
29+
- match: { nodes.$node_id.roles.1: "data_cold" }
30+
- match: { nodes.$node_id.roles.2: "data_content" }
31+
- match: { nodes.$node_id.roles.3: "data_frozen" }
32+
- match: { nodes.$node_id.roles.4: "data_hot" }
33+
- match: { nodes.$node_id.roles.5: "data_warm" }
34+
- match: { nodes.$node_id.roles.6: "ingest" }
35+
- match: { nodes.$node_id.roles.7: "master" }
36+
- match: { nodes.$node_id.roles.8: "remote_cluster_client" }

server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsIT.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ public void testNodeCounts() {
5858
internalCluster().startNode();
5959
Map<String, Integer> expectedCounts = new HashMap<>();
6060
expectedCounts.put(DiscoveryNodeRole.DATA_ROLE.roleName(), 1);
61+
expectedCounts.put(DiscoveryNodeRole.DATA_CONTENT_NODE_ROLE.roleName(), 1);
62+
expectedCounts.put(DiscoveryNodeRole.DATA_COLD_NODE_ROLE.roleName(), 1);
63+
expectedCounts.put(DiscoveryNodeRole.DATA_FROZEN_NODE_ROLE.roleName(), 1);
64+
expectedCounts.put(DiscoveryNodeRole.DATA_HOT_NODE_ROLE.roleName(), 1);
65+
expectedCounts.put(DiscoveryNodeRole.DATA_WARM_NODE_ROLE.roleName(), 1);
6166
expectedCounts.put(DiscoveryNodeRole.MASTER_ROLE.roleName(), 1);
6267
expectedCounts.put(DiscoveryNodeRole.INGEST_ROLE.roleName(), 1);
6368
expectedCounts.put(DiscoveryNodeRole.REMOTE_CLUSTER_CLIENT_ROLE.roleName(), 1);

server/src/internalClusterTest/java/org/elasticsearch/env/NodeEnvironmentIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void testStartFailureOnDataForNonDataNode() throws Exception {
6868
internalCluster().restartRandomDataNode(new InternalTestCluster.RestartCallback() {
6969
@Override
7070
public Settings onNodeStopped(String nodeName) {
71-
return NodeRoles.removeRoles(Set.of(DiscoveryNodeRole.DATA_ROLE, DiscoveryNodeRole.MASTER_ROLE));
71+
return NodeRoles.removeRoles(nonDataNode(), Set.of(DiscoveryNodeRole.MASTER_ROLE));
7272
}
7373
}));
7474
if (writeDanglingIndices) {

server/src/internalClusterTest/java/org/elasticsearch/env/NodeRepurposeCommandIT.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import org.elasticsearch.test.ESIntegTestCase;
1515
import org.hamcrest.Matcher;
1616

17+
import static org.elasticsearch.test.NodeRoles.nonDataNode;
18+
import static org.elasticsearch.test.NodeRoles.nonMasterNode;
1719
import static org.hamcrest.Matchers.allOf;
1820
import static org.hamcrest.Matchers.containsString;
1921

@@ -45,7 +47,7 @@ public void testRepurpose() throws Exception {
4547
final Settings dataNodeDataPathSettings = internalCluster().dataPathSettings(dataNode);
4648

4749
// put some unknown role here to make sure the tool does not bark when encountering an unknown role
48-
final Settings noMasterNoDataSettings = Settings.builder().putList("node.roles", "unknown_role").build();
50+
final Settings noMasterNoDataSettings = nonMasterNode(nonDataNode());
4951

5052
final Settings noMasterNoDataSettingsForMasterNode = Settings.builder()
5153
.put(noMasterNoDataSettings)

server/src/internalClusterTest/java/org/elasticsearch/index/store/CorruptedFileIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public void testCorruptionOnNetworkLayerFinalizingRecovery() throws ExecutionExc
323323
NodesStatsResponse nodeStats = client().admin().cluster().prepareNodesStats().get();
324324
List<NodeStats> dataNodeStats = new ArrayList<>();
325325
for (NodeStats stat : nodeStats.getNodes()) {
326-
if (stat.getNode().isDataNode()) {
326+
if (stat.getNode().canContainData()) {
327327
dataNodeStats.add(stat);
328328
}
329329
}
@@ -383,7 +383,7 @@ public void testCorruptionOnNetworkLayer() throws ExecutionException, Interrupte
383383
NodesStatsResponse nodeStats = client().admin().cluster().prepareNodesStats().get();
384384
List<NodeStats> dataNodeStats = new ArrayList<>();
385385
for (NodeStats stat : nodeStats.getNodes()) {
386-
if (stat.getNode().isDataNode()) {
386+
if (stat.getNode().canContainData()) {
387387
dataNodeStats.add(stat);
388388
}
389389
}

server/src/internalClusterTest/java/org/elasticsearch/index/store/ExceptionRetryIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public void testRetryDueToExceptionOnNetworkLayer() throws ExecutionException, I
7171
int numDocs = scaledRandomIntBetween(100, 1000);
7272
Client client = internalCluster().coordOnlyNodeClient();
7373
NodesStatsResponse nodeStats = client().admin().cluster().prepareNodesStats().get();
74-
NodeStats unluckyNode = randomFrom(nodeStats.getNodes().stream().filter((s) -> s.getNode().isDataNode())
74+
NodeStats unluckyNode = randomFrom(nodeStats.getNodes().stream().filter((s) -> s.getNode().canContainData())
7575
.collect(Collectors.toList()));
7676
assertAcked(client().admin().indices().prepareCreate("index").setSettings(Settings.builder()
7777
.put("index.number_of_replicas", 1)

server/src/internalClusterTest/java/org/elasticsearch/indices/memory/breaker/CircuitBreakerServiceIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ public void testLimitsRequestSize() {
325325
NodesStatsResponse nodeStats = client().admin().cluster().prepareNodesStats().get();
326326
List<NodeStats> dataNodeStats = new ArrayList<>();
327327
for (NodeStats stat : nodeStats.getNodes()) {
328-
if (stat.getNode().isDataNode()) {
328+
if (stat.getNode().canContainData()) {
329329
dataNodeStats.add(stat);
330330
}
331331
}

server/src/internalClusterTest/java/org/elasticsearch/indices/state/CloseWhileRelocatingShardsIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public void testCloseWhileRelocatingShards() throws Exception {
179179
(MockTransportService) internalCluster().getInstance(TransportService.class, targetNode);
180180

181181
for (DiscoveryNode node : state.getNodes()) {
182-
if (node.isDataNode() && node.getName().equals(targetNode) == false) {
182+
if (node.canContainData() && node.getName().equals(targetNode) == false) {
183183
final TransportService sourceTransportService = internalCluster().getInstance(TransportService.class, node.getName());
184184
targetTransportService.addSendBehavior(sourceTransportService, sendBehavior);
185185
}

server/src/internalClusterTest/java/org/elasticsearch/recovery/TruncatedRecoveryIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void testCancelRecoveryAndResume() throws Exception {
6262
NodesStatsResponse nodeStats = client().admin().cluster().prepareNodesStats().get();
6363
List<NodeStats> dataNodeStats = new ArrayList<>();
6464
for (NodeStats stat : nodeStats.getNodes()) {
65-
if (stat.getNode().isDataNode()) {
65+
if (stat.getNode().canContainData()) {
6666
dataNodeStats.add(stat);
6767
}
6868
}

server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CrossClusterSearchIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public void testCancel() throws Exception {
151151
if (randomBoolean()) {
152152
remoteCluster.ensureAtLeastNumDataNodes(3);
153153
List<String> remoteDataNodes = StreamSupport.stream(remoteCluster.clusterService().state().nodes().spliterator(), false)
154-
.filter(DiscoveryNode::isDataNode)
154+
.filter(DiscoveryNode::canContainData)
155155
.map(DiscoveryNode::getName)
156156
.collect(Collectors.toList());
157157
assertThat(remoteDataNodes.size(), Matchers.greaterThanOrEqualTo(3));

0 commit comments

Comments
 (0)