Skip to content

Commit

Permalink
Adding a warning if node.attr.data is set (elastic#84050)
Browse files Browse the repository at this point in the history
This adds a warning-level deprecation if a user has set the node.attr.data setting, since it is a sign that they are
trying to create a hot/warm setup in the way that is no longer supported.
Closes elastic#83800
  • Loading branch information
masseyke authored and probakowski committed Feb 23, 2022
1 parent d70bdc1 commit d6b2ba7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ private DeprecationChecks() {}
NodeDeprecationChecks::checkScriptContextCacheExpirationSetting,
NodeDeprecationChecks::checkEnforceDefaultTierPreferenceSetting,
NodeDeprecationChecks::checkLifecyleStepMasterTimeoutSetting,
NodeDeprecationChecks::checkEqlEnabledSetting
NodeDeprecationChecks::checkEqlEnabledSetting,
NodeDeprecationChecks::checkNodeAttrData
);

static List<Function<IndexMetadata, DeprecationIssue>> INDEX_SETTINGS_CHECKS = List.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<DeprecationIssue> 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));
}
}

0 comments on commit d6b2ba7

Please sign in to comment.