diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java index 554cda77fa639..a537141ca5c46 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java @@ -99,6 +99,7 @@ private DeprecationChecks() { NodeDeprecationChecks::checkAcceptDefaultPasswordSetting, NodeDeprecationChecks::checkAcceptRolesCacheMaxSizeSetting, NodeDeprecationChecks::checkRolesCacheTTLSizeSetting, + NodeDeprecationChecks::checkMaxLocalStorageNodesSetting, NodeDeprecationChecks::checkClusterRoutingAllocationIncludeRelocationsSetting ) ).collect(Collectors.toList()); diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java index ff75f40e35d48..5cfe6cb75e175 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java @@ -23,6 +23,7 @@ import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.core.TimeValue; import org.elasticsearch.env.Environment; +import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.jdk.JavaVersion; import org.elasticsearch.license.License; import org.elasticsearch.license.XPackLicenseState; @@ -637,4 +638,15 @@ static DeprecationIssue checkRolesCacheTTLSizeSetting(final Settings settings, DeprecationIssue.Level.CRITICAL ); } + + static DeprecationIssue checkMaxLocalStorageNodesSetting(final Settings settings, + final PluginsAndModules pluginsAndModules, + final ClusterState clusterState, + final XPackLicenseState licenseState) { + return checkRemovedSetting(settings, + NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING, + "https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_node_changes", + DeprecationIssue.Level.CRITICAL + ); + } } diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java index 20bbf506f8198..30507dfec264b 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java @@ -21,6 +21,7 @@ import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.core.Set; import org.elasticsearch.env.Environment; +import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.jdk.JavaVersion; import org.elasticsearch.license.License; import org.elasticsearch.license.XPackLicenseState; @@ -915,4 +916,12 @@ public void testCheckRolesCacheTTLSizeSetting() { String url = "https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_security_changes"; checkSimpleSetting(settingKey, settingValue, url, NodeDeprecationChecks::checkRolesCacheTTLSizeSetting); } + + public void testCheckMaxLocalStorageNodesSetting() { + String settingKey = NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.getKey(); + String settingValue = Integer.toString(randomIntBetween(1, 100)); + String url = "https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_node_changes"; + checkSimpleSetting(settingKey, settingValue, url, NodeDeprecationChecks::checkMaxLocalStorageNodesSetting); + } + }