mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
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:
parent
c756ce1acf
commit
bf78062ac5
2 changed files with 10 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue