Skip to content

Commit

Permalink
Feature/deprecation info max local storage nodes (#76990)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
masseyke authored Sep 2, 2021
1 parent 0363933 commit 15ff546
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ private DeprecationChecks() {
NodeDeprecationChecks::checkAcceptDefaultPasswordSetting,
NodeDeprecationChecks::checkAcceptRolesCacheMaxSizeSetting,
NodeDeprecationChecks::checkRolesCacheTTLSizeSetting,
NodeDeprecationChecks::checkMaxLocalStorageNodesSetting,
NodeDeprecationChecks::checkClusterRoutingAllocationIncludeRelocationsSetting
)
).collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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;
Expand Down Expand Up @@ -730,4 +731,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
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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;
Expand Down Expand Up @@ -1077,4 +1078,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);
}

}

0 comments on commit 15ff546

Please sign in to comment.