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 b0869c2b41eeb..28548d71932fc 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 @@ -82,7 +82,8 @@ private DeprecationChecks() {} NodeDeprecationChecks::checkScriptContextCacheExpirationSetting, NodeDeprecationChecks::checkEnforceDefaultTierPreferenceSetting, NodeDeprecationChecks::checkLifecyleStepMasterTimeoutSetting, - NodeDeprecationChecks::checkEqlEnabledSetting + NodeDeprecationChecks::checkEqlEnabledSetting, + NodeDeprecationChecks::checkNodeAttrData ); static List> INDEX_SETTINGS_CHECKS = List.of( 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 ab3230cd0baaf..40be68851a765 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 @@ -616,4 +616,20 @@ static DeprecationIssue checkEqlEnabledSetting(final Settings settings, final Pl ); } + static DeprecationIssue checkNodeAttrData(final Settings settings, final PluginsAndModules pluginsAndModules) { + String nodeAttrDataValue = settings.get("node.attr.data"); + if (nodeAttrDataValue == null) { + return null; + } + return new DeprecationIssue( + DeprecationIssue.Level.WARNING, + "Setting node.attributes.data is not recommended", + "https://ela.st/es-deprecation-7-node-attr-data-setting", + "One or more of your nodes is configured with node.attributes.data settings. This is typically used to create a " + + "hot/warm or tiered architecture, based on legacy guidelines. Data tiers are a recommended replacement for tiered " + + "architecture clusters.", + false, + null + ); + } } 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 3a004dc4da692..124d2f19ee62b 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 @@ -675,4 +675,21 @@ public void testEqlEnabledSetting() { ) ); } + + public void testCheckNodeAttrData() { + Settings settings = Settings.builder().put("node.attr.data", randomAlphaOfLength(randomIntBetween(4, 20))).build(); + final PluginsAndModules pluginsAndModules = new PluginsAndModules(Collections.emptyList(), Collections.emptyList()); + final List issues = getDeprecationIssues(settings, pluginsAndModules); + final DeprecationIssue expected = new DeprecationIssue( + DeprecationIssue.Level.WARNING, + "Setting node.attributes.data is not recommended", + "https://ela.st/es-deprecation-7-node-attr-data-setting", + "One or more of your nodes is configured with node.attributes.data settings. This is typically used to create a " + + "hot/warm or tiered architecture, based on legacy guidelines. Data tiers are a recommended replacement for tiered " + + "architecture clusters.", + false, + null + ); + assertThat(issues, hasItem(expected)); + } }