Skip to content

Commit

Permalink
Adjust bwc logic after backporting #76881 (#77167)
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnvg committed Sep 2, 2021
1 parent c082c25 commit dd277f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -164,7 +164,7 @@ DiscoveryNode selectNodeForPolicyExecution(DiscoveryNodes discoNodes) {
// filter out dedicated master nodes
.filter(discoNode -> discoNode.getRoles().equals(Set.of(DiscoveryNodeRole.MASTER_ROLE)) == false)
// Filter out nodes that don't have this action yet
.filter(discoNode -> discoNode.getVersion().onOrAfter(Version.V_8_0_0))
.filter(discoNode -> discoNode.getVersion().onOrAfter(Version.V_7_15_0))
.toArray(DiscoveryNode[]::new);
if (nodes.length == 0) {
throw new IllegalStateException("no suitable node was found to perform enrich policy execution");
Expand Down
Expand Up @@ -92,8 +92,8 @@ public void testSelectNodeForPolicyExecutionNoNodeWithIngestRole() {
}

public void testSelectNodeForPolicyExecutionMixedVersions() {
var node1 = newNode(randomAlphaOfLength(4), Version.V_7_16_0);
var node2 = newNode(randomAlphaOfLength(4), Version.V_7_16_0);
var node1 = newNode(randomAlphaOfLength(4), Version.V_7_14_0);
var node2 = newNode(randomAlphaOfLength(4), Version.V_7_14_0);
var node3 = newNode(randomAlphaOfLength(4));
var discoNodes = DiscoveryNodes.builder()
.add(node1)
Expand Down Expand Up @@ -122,7 +122,7 @@ public void testSelectNodeForPolicyExecutionPickLocalNodeIfNotElectedMaster() {
}

private static DiscoveryNode newNode(String nodeId) {
return newNode(nodeId, Version.V_8_0_0);
return newNode(nodeId, Version.V_7_15_0);
}

private static DiscoveryNode newNode(String nodeId, Version version) {
Expand All @@ -131,7 +131,7 @@ private static DiscoveryNode newNode(String nodeId, Version version) {
}

private static DiscoveryNode newNode(String nodeId, Set<DiscoveryNodeRole> roles) {
return newNode(nodeId, roles, Version.V_8_0_0);
return newNode(nodeId, roles, Version.V_7_15_0);
}

private static DiscoveryNode newNode(String nodeId, Set<DiscoveryNodeRole> roles, Version version) {
Expand Down

0 comments on commit dd277f6

Please sign in to comment.