Skip to content

Commit

Permalink
A node with roles [ml, remote_cluster_client] is still dedicated ML (#…
Browse files Browse the repository at this point in the history
…66533)

Where CCS is being used it makes sense for ML nodes to have the
remote_cluster_client role.  This single extra role is not
significant enough to stop an ML node being considered a
"dedicated ML node".
  • Loading branch information
droberts195 authored Dec 18, 2020
1 parent c756ce1 commit bf78062
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public static MachineNodeRole parse(InputStream config) {
return MachineNodeRole.DATA;
} else if (containsOnly(roles, "master")) {
return MachineNodeRole.MASTER_ONLY;
} else if (containsOnly(roles, "ml")) {
} else if (roles.contains("ml") && containsOnly(roles, "ml", "remote_cluster_client")) {
return MachineNodeRole.ML_ONLY;
} else {
return MachineNodeRole.DATA;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ public void testMlOnlyNode() throws IOException {
MachineDependentHeap.MachineNodeRole nodeRole = parseConfig(sb -> sb.append("node.roles: [ml]"));
assertThat(nodeRole, equalTo(ML_ONLY));

nodeRole = parseConfig(sb -> sb.append("node.roles: [ml, remote_cluster_client]"));
assertThat(nodeRole, equalTo(ML_ONLY));

nodeRole = parseConfig(sb -> sb.append("node.roles: [remote_cluster_client, ml]"));
assertThat(nodeRole, equalTo(ML_ONLY));

nodeRole = parseConfig(sb -> sb.append("node.roles: [remote_cluster_client]"));
assertThat(nodeRole, not(equalTo(ML_ONLY)));

nodeRole = parseConfig(sb -> sb.append("node.roles: [ml, some_other_role]"));
assertThat(nodeRole, not(equalTo(ML_ONLY)));
}
Expand Down

0 comments on commit bf78062

Please sign in to comment.