Skip to content

Commit 15ff546

Browse files
authored
Feature/deprecation info max local storage nodes (#76990)
The "node.max_local_storage_nodes" property has been removed in 8.0. This commit adds a deprecation info API check for the property. Relates #42404 #42428
1 parent 0363933 commit 15ff546

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ private DeprecationChecks() {
105105
NodeDeprecationChecks::checkAcceptDefaultPasswordSetting,
106106
NodeDeprecationChecks::checkAcceptRolesCacheMaxSizeSetting,
107107
NodeDeprecationChecks::checkRolesCacheTTLSizeSetting,
108+
NodeDeprecationChecks::checkMaxLocalStorageNodesSetting,
108109
NodeDeprecationChecks::checkClusterRoutingAllocationIncludeRelocationsSetting
109110
)
110111
).collect(Collectors.toList());

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.elasticsearch.common.util.set.Sets;
2525
import org.elasticsearch.core.TimeValue;
2626
import org.elasticsearch.env.Environment;
27+
import org.elasticsearch.env.NodeEnvironment;
2728
import org.elasticsearch.jdk.JavaVersion;
2829
import org.elasticsearch.license.License;
2930
import org.elasticsearch.license.XPackLicenseState;
@@ -730,4 +731,15 @@ static DeprecationIssue checkRolesCacheTTLSizeSetting(final Settings settings,
730731
DeprecationIssue.Level.CRITICAL
731732
);
732733
}
734+
735+
static DeprecationIssue checkMaxLocalStorageNodesSetting(final Settings settings,
736+
final PluginsAndModules pluginsAndModules,
737+
final ClusterState clusterState,
738+
final XPackLicenseState licenseState) {
739+
return checkRemovedSetting(settings,
740+
NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING,
741+
"https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_node_changes",
742+
DeprecationIssue.Level.CRITICAL
743+
);
744+
}
733745
}

x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.elasticsearch.common.util.concurrent.EsExecutors;
2323
import org.elasticsearch.core.Set;
2424
import org.elasticsearch.env.Environment;
25+
import org.elasticsearch.env.NodeEnvironment;
2526
import org.elasticsearch.jdk.JavaVersion;
2627
import org.elasticsearch.license.License;
2728
import org.elasticsearch.license.XPackLicenseState;
@@ -1077,4 +1078,12 @@ public void testCheckRolesCacheTTLSizeSetting() {
10771078
String url = "https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_security_changes";
10781079
checkSimpleSetting(settingKey, settingValue, url, NodeDeprecationChecks::checkRolesCacheTTLSizeSetting);
10791080
}
1081+
1082+
public void testCheckMaxLocalStorageNodesSetting() {
1083+
String settingKey = NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.getKey();
1084+
String settingValue = Integer.toString(randomIntBetween(1, 100));
1085+
String url = "https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_node_changes";
1086+
checkSimpleSetting(settingKey, settingValue, url, NodeDeprecationChecks::checkMaxLocalStorageNodesSetting);
1087+
}
1088+
10801089
}

0 commit comments

Comments
 (0)