Skip to content

Commit e5acb99

Browse files
authored
Not reporting removable settings for deprecated affix settings (#84246)
Removing one setting from a group of affix settings can cause Elasticsearch to get into an inconsistent state. This commit makes it so that we never report removable affix settings in the deprecation info API.
1 parent ee61c04 commit e5acb99

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,10 +1461,10 @@ private static DeprecationIssue deprecatedAffixSetting(
14611461
if (canBeFixedByRemovingDynamicSetting) {
14621462
deprecatedClusterSettingKeys.removeAll(deprecatedNodeSettingKeys);
14631463
}
1464-
final Map<String, Object> meta = createMetaMapForRemovableSettings(
1465-
canBeFixedByRemovingDynamicSetting,
1466-
deprecatedClusterSettingKeys
1467-
);
1464+
/* Removing affix settings can cause more problems than it's worth, so always make meta null even if the settings are only set
1465+
* dynamically
1466+
*/
1467+
final Map<String, Object> meta = null;
14681468
return new DeprecationIssue(warningLevel, message, url, details, false, meta);
14691469
}
14701470

@@ -1523,7 +1523,10 @@ private static DeprecationIssue deprecatedAffixGroupedSetting(
15231523
if (canBeFixedByRemovingDynamicSetting) {
15241524
allClusterSubSettingKeys.removeAll(allNodeSubSettingKeys);
15251525
}
1526-
final Map<String, Object> meta = createMetaMapForRemovableSettings(canBeFixedByRemovingDynamicSetting, allClusterSubSettingKeys);
1526+
/* Removing affix settings can cause more problems than it's worth, so always make meta null even if the settings are only set
1527+
* dynamically
1528+
*/
1529+
final Map<String, Object> meta = null;
15271530
return new DeprecationIssue(warningLevel, message, url, details, false, meta);
15281531
}
15291532

x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,7 @@ void monitoringExporterGroupedSetting(String suffix, String value) throws JsonPr
18931893
c -> c.apply(nodeSettings, null, clusterState, licenseState)
18941894
);
18951895
final String expectedUrl = "https://ela.st/es-deprecation-7-monitoring-settings";
1896-
Map<String, Object> meta = buildMetaObjectForRemovableSettings(subSetting1Key2, subSetting2Key2);
1896+
Map<String, Object> meta = null;
18971897
assertThat(
18981898
issues,
18991899
hasItem(

0 commit comments

Comments
 (0)