Skip to content

Commit

Permalink
Change version check for cluster manager throttling setting to 2.5 (o…
Browse files Browse the repository at this point in the history
…pensearch-project#5617)

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
  • Loading branch information
dhwanilpatel authored Dec 22, 2022
1 parent 00e4e92 commit 9c03010
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public boolean isThrottlingEnabled() {
void validateSetting(final Settings settings) {
Map<String, Settings> groups = settings.getAsGroups();
if (groups.size() > 0) {
if (minNodeVersionSupplier.get().compareTo(Version.V_2_4_0) < 0) {
throw new IllegalArgumentException("All the nodes in cluster should be on version later than or equal to 2.4.0");
if (minNodeVersionSupplier.get().compareTo(Version.V_2_5_0) < 0) {
throw new IllegalArgumentException("All the nodes in cluster should be on version later than or equal to 2.5.0");
}
}
for (String key : groups.keySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void testDefaults() {
}

public void testValidateSettingsForDifferentVersion() {
DiscoveryNode clusterManagerNode = getClusterManagerNode(Version.V_2_4_0);
DiscoveryNode clusterManagerNode = getClusterManagerNode(Version.V_2_5_0);
DiscoveryNode dataNode = getDataNode(Version.V_2_0_0);
setState(
clusterService,
Expand Down Expand Up @@ -116,8 +116,8 @@ public void testValidateSettingsForDifferentVersion() {
}

public void testValidateSettingsForTaskWihtoutRetryOnDataNode() {
DiscoveryNode clusterManagerNode = getClusterManagerNode(Version.V_2_4_0);
DiscoveryNode dataNode = getDataNode(Version.V_2_4_0);
DiscoveryNode clusterManagerNode = getClusterManagerNode(Version.V_2_5_0);
DiscoveryNode dataNode = getDataNode(Version.V_2_5_0);
setState(
clusterService,
ClusterStateCreationUtils.state(clusterManagerNode, clusterManagerNode, new DiscoveryNode[] { clusterManagerNode, dataNode })
Expand All @@ -140,8 +140,8 @@ public void testValidateSettingsForTaskWihtoutRetryOnDataNode() {
}

public void testUpdateSettingsForNullValue() {
DiscoveryNode clusterManagerNode = getClusterManagerNode(Version.V_2_4_0);
DiscoveryNode dataNode = getDataNode(Version.V_2_4_0);
DiscoveryNode clusterManagerNode = getClusterManagerNode(Version.V_2_5_0);
DiscoveryNode dataNode = getDataNode(Version.V_2_5_0);
setState(
clusterService,
ClusterStateCreationUtils.state(clusterManagerNode, clusterManagerNode, new DiscoveryNode[] { clusterManagerNode, dataNode })
Expand Down Expand Up @@ -169,8 +169,8 @@ public void testUpdateSettingsForNullValue() {
}

public void testSettingsOnBootstrap() {
DiscoveryNode clusterManagerNode = getClusterManagerNode(Version.V_2_4_0);
DiscoveryNode dataNode = getDataNode(Version.V_2_4_0);
DiscoveryNode clusterManagerNode = getClusterManagerNode(Version.V_2_5_0);
DiscoveryNode dataNode = getDataNode(Version.V_2_5_0);
setState(
clusterService,
ClusterStateCreationUtils.state(clusterManagerNode, clusterManagerNode, new DiscoveryNode[] { clusterManagerNode, dataNode })
Expand All @@ -194,8 +194,8 @@ public void testSettingsOnBootstrap() {
}

public void testValidateSettingsForUnknownTask() {
DiscoveryNode clusterManagerNode = getClusterManagerNode(Version.V_2_4_0);
DiscoveryNode dataNode = getDataNode(Version.V_2_4_0);
DiscoveryNode clusterManagerNode = getClusterManagerNode(Version.V_2_5_0);
DiscoveryNode dataNode = getDataNode(Version.V_2_5_0);
setState(
clusterService,
ClusterStateCreationUtils.state(clusterManagerNode, clusterManagerNode, new DiscoveryNode[] { clusterManagerNode, dataNode })
Expand All @@ -216,8 +216,8 @@ public void testValidateSettingsForUnknownTask() {
}

public void testUpdateThrottlingLimitForBasicSanity() {
DiscoveryNode clusterManagerNode = getClusterManagerNode(Version.V_2_4_0);
DiscoveryNode dataNode = getDataNode(Version.V_2_4_0);
DiscoveryNode clusterManagerNode = getClusterManagerNode(Version.V_2_5_0);
DiscoveryNode dataNode = getDataNode(Version.V_2_5_0);
setState(
clusterService,
ClusterStateCreationUtils.state(clusterManagerNode, clusterManagerNode, new DiscoveryNode[] { clusterManagerNode, dataNode })
Expand Down Expand Up @@ -246,8 +246,8 @@ public void testUpdateThrottlingLimitForBasicSanity() {
}

public void testValidateSettingForLimit() {
DiscoveryNode clusterManagerNode = getClusterManagerNode(Version.V_2_4_0);
DiscoveryNode dataNode = getDataNode(Version.V_2_4_0);
DiscoveryNode clusterManagerNode = getClusterManagerNode(Version.V_2_5_0);
DiscoveryNode dataNode = getDataNode(Version.V_2_5_0);
setState(
clusterService,
ClusterStateCreationUtils.state(clusterManagerNode, clusterManagerNode, new DiscoveryNode[] { clusterManagerNode, dataNode })
Expand Down

0 comments on commit 9c03010

Please sign in to comment.