Add node local storage deprecation check (#54383)

The node.local_storage setting has been deprecated and will be removed
in 8.0.0. This commit adds a deprecation check to 7.x.
This commit is contained in:
Jason Tedor 2020-03-30 10:23:43 -04:00 committed by GitHub
parent 67b9b68c66
commit 39b3010578
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 1 deletions

View File

@ -48,7 +48,8 @@ public class DeprecationChecks {
NodeDeprecationChecks::checkUniqueRealmOrders,
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkThreadPoolListenerQueueSize(settings),
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkThreadPoolListenerSize(settings),
NodeDeprecationChecks::checkClusterRemoteConnectSetting
NodeDeprecationChecks::checkClusterRemoteConnectSetting,
NodeDeprecationChecks::checkNodeLocalStorageSetting
));
static List<Function<IndexMetaData, DeprecationIssue>> INDEX_SETTINGS_CHECKS =

View File

@ -129,6 +129,14 @@ class NodeDeprecationChecks {
);
}
public static DeprecationIssue checkNodeLocalStorageSetting(final Settings settings, final PluginsAndModules pluginsAndModules) {
return checkRemovedSetting(
settings,
Node.NODE_LOCAL_STORAGE_SETTING,
"https://www.elastic.co/guide/en/elasticsearch/reference/7.8/breaking-changes-7.8.html#deprecate-node-local-storage"
);
}
private static DeprecationIssue checkDeprecatedSetting(
final Settings settings,
final PluginsAndModules pluginsAndModules,

View File

@ -199,6 +199,22 @@ public class NodeDeprecationChecksTests extends ESTestCase {
assertSettingDeprecationsAndWarnings(new Setting<?>[]{RemoteClusterService.ENABLE_REMOTE_CLUSTERS});
}
public void testNodeLocalStorageSetting() {
final boolean value = randomBoolean();
final Settings settings = Settings.builder().put(Node.NODE_LOCAL_STORAGE_SETTING.getKey(), value).build();
final PluginsAndModules pluginsAndModules = new PluginsAndModules(Collections.emptyList(), Collections.emptyList());
final List<DeprecationIssue> issues =
DeprecationChecks.filterChecks(DeprecationChecks.NODE_SETTINGS_CHECKS, c -> c.apply(settings, pluginsAndModules));
final DeprecationIssue expected = new DeprecationIssue(
DeprecationIssue.Level.CRITICAL,
"setting [node.local_storage] is deprecated and will be removed in the next major version",
"https://www.elastic.co/guide/en/elasticsearch/reference/7.8/breaking-changes-7.8.html#deprecate-node-local-storage",
"the setting [node.local_storage] is currently set to [" + value + "], remove this setting"
);
assertThat(issues, contains(expected));
assertSettingDeprecationsAndWarnings(new Setting<?>[]{Node.NODE_LOCAL_STORAGE_SETTING});
}
public void testRemovedSettingNotSet() {
final Settings settings = Settings.EMPTY;
final Setting<?> removedSetting = Setting.simpleString("node.removed_setting");