A node with roles [ml, remote_cluster_client] is still dedicated ML (#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".
This commit is contained in:
David Roberts 2020-12-18 13:00:23 +00:00 committed by GitHub
parent c756ce1acf
commit bf78062ac5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -142,7 +142,7 @@ public final class MachineDependentHeap {
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;

View file

@ -47,6 +47,15 @@ public class NodeRoleParserTests extends LaunchersTestCase {
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)));
}