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:
parent
67b9b68c66
commit
39b3010578
|
@ -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 =
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue