Skip to content

Commit 91837fe

Browse files
Add xpack setting deprecations to deprecation API (#56290)
* Add xpack setting deprecations to deprecation API The deprecated settings showed up in the deprecation log file by default, but I did not add them to the deprecation API. This commit fixes that. Now if you use one of the deprecated basic feature enablement settings, calling _monitoring/deprecations will inform you of that fact. * Remove incorrectly backported settings documents It seems that I backported these docs to the wrong place in #56061, in #55980, and in #56167. I hope they're in the right place now. Co-authored-by: debadair <[email protected]>
1 parent 6be5b05 commit 91837fe

File tree

5 files changed

+91
-26
lines changed

5 files changed

+91
-26
lines changed

docs/reference/migration/migrate_7_0/settings.asciidoc

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -288,28 +288,3 @@ still be adjusted as desired using the cluster settings API.
288288
==== HTTP Max content length setting is no longer parsed leniently
289289
Previously, `http.max_content_length` would reset to `100mb` if the setting was
290290
greater than `Integer.MAX_VALUE`. This leniency has been removed.
291-
292-
[float]
293-
==== Option to disable basic license features is deprecated
294-
295-
In Elasticsearch 7.8.0, the following settings no longer have any effect, and
296-
have been deprecated:
297-
298-
* `xpack.enrich.enabled`
299-
* `xpack.flattened.enabled`
300-
* `xpack.ilm.enabled`
301-
* `xpack.monitoring.enabled`
302-
* `xpack.rollup.enabled`
303-
* `xpack.slm.enabled`
304-
* `xpack.sql.enabled`
305-
* `xpack.transform.enabled`
306-
* `xpack.vectors.enabled`
307-
308-
Previously, these settings could be set to `false` in order to disable the
309-
feature's APIs in a cluster. As of 7.8.0, these basic license features are
310-
always enabled for the {default-dist}.
311-
312-
If you have disabled ILM so that you can use another tool to manage Watcher
313-
indices, the newly introduced `xpack.watcher.use_ilm_index_management` setting
314-
may be set to false.
315-

docs/reference/migration/migrate_7_8.asciidoc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,35 @@ To avoid deprecation warnings, discontinue use of the `node.local_storage`
9292
setting.
9393
====
9494

95+
[[deprecate-basic-license-feature-enabled]]
96+
97+
.Several {xpack} settings no longer have any effect and are deprecated.
98+
99+
[%collapsible]
100+
====
101+
*Details* +
102+
Basic {xpack} license features are always enabled for the {default-dist}
103+
and the following settings no longer have any effect:
104+
105+
* `xpack.enrich.enabled`
106+
* `xpack.flattened.enabled`
107+
* `xpack.ilm.enabled`
108+
* `xpack.monitoring.enabled`
109+
* `xpack.rollup.enabled`
110+
* `xpack.slm.enabled`
111+
* `xpack.sql.enabled`
112+
* `xpack.transform.enabled`
113+
* `xpack.vectors.enabled`
114+
115+
Previously, they could be set to `false` to disable the feature's APIs in a cluster.
116+
117+
*Impact* +
118+
To avoid deprecation warnings, discontinue use of these settings.
119+
If you have disabled ILM so that you can use another tool to manage Watcher
120+
indices, the newly introduced `xpack.watcher.use_ilm_index_management` setting
121+
may be set to false.
122+
====
123+
95124
[float]
96125
[[builtin-users-changes]]
97126
==== Changes to built-in users

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.elasticsearch.cluster.metadata.IndexMetadata;
1111
import org.elasticsearch.common.settings.Settings;
1212
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
13+
import org.elasticsearch.xpack.core.XPackSettings;
1314
import org.elasticsearch.xpack.core.deprecation.DeprecationInfoAction;
1415
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
1516
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig;
@@ -49,7 +50,25 @@ private DeprecationChecks() {
4950
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkThreadPoolListenerQueueSize(settings),
5051
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkThreadPoolListenerSize(settings),
5152
NodeDeprecationChecks::checkClusterRemoteConnectSetting,
52-
NodeDeprecationChecks::checkNodeLocalStorageSetting
53+
NodeDeprecationChecks::checkNodeLocalStorageSetting,
54+
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
55+
XPackSettings.ENRICH_ENABLED_SETTING),
56+
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
57+
XPackSettings.FLATTENED_ENABLED),
58+
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
59+
XPackSettings.INDEX_LIFECYCLE_ENABLED),
60+
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
61+
XPackSettings.MONITORING_ENABLED),
62+
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
63+
XPackSettings.ROLLUP_ENABLED),
64+
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
65+
XPackSettings.SNAPSHOT_LIFECYCLE_ENABLED),
66+
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
67+
XPackSettings.SQL_ENABLED),
68+
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
69+
XPackSettings.TRANSFORM_ENABLED),
70+
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
71+
XPackSettings.VECTORS_ENABLED)
5372
));
5473

5574
static List<Function<IndexMetadata, DeprecationIssue>> INDEX_SETTINGS_CHECKS =

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ public static DeprecationIssue checkNodeLocalStorageSetting(final Settings setti
137137
);
138138
}
139139

140+
public static DeprecationIssue checkNodeBasicLicenseFeatureEnabledSetting(final Settings settings, Setting<?> setting) {
141+
return checkRemovedSetting(
142+
settings,
143+
setting,
144+
"https://www.elastic.co/guide/en/elasticsearch/reference/7.8/breaking-changes-7.8.html#deprecate-basic-license-feature-enabled"
145+
);
146+
}
147+
140148
private static DeprecationIssue checkDeprecatedSetting(
141149
final Settings settings,
142150
final PluginsAndModules pluginsAndModules,

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@
77
package org.elasticsearch.xpack.deprecation;
88

99
import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules;
10+
import org.elasticsearch.common.collect.Set;
1011
import org.elasticsearch.common.settings.Setting;
1112
import org.elasticsearch.common.settings.Settings;
1213
import org.elasticsearch.common.util.concurrent.EsExecutors;
1314
import org.elasticsearch.env.Environment;
1415
import org.elasticsearch.node.Node;
1516
import org.elasticsearch.test.ESTestCase;
1617
import org.elasticsearch.transport.RemoteClusterService;
18+
import org.elasticsearch.xpack.core.XPackSettings;
1719
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
1820
import org.elasticsearch.xpack.core.security.authc.RealmConfig;
1921
import org.elasticsearch.xpack.core.security.authc.RealmSettings;
2022

23+
import java.util.Collection;
2124
import java.util.Collections;
2225
import java.util.List;
2326
import java.util.Locale;
@@ -215,6 +218,37 @@ public void testNodeLocalStorageSetting() {
215218
assertSettingDeprecationsAndWarnings(new Setting<?>[]{Node.NODE_LOCAL_STORAGE_SETTING});
216219
}
217220

221+
public void testDeprecatedBasicLicenseSettings() {
222+
Collection<Setting<Boolean>> deprecatedXpackSettings = Set.of(
223+
XPackSettings.ENRICH_ENABLED_SETTING,
224+
XPackSettings.FLATTENED_ENABLED,
225+
XPackSettings.INDEX_LIFECYCLE_ENABLED,
226+
XPackSettings.MONITORING_ENABLED,
227+
XPackSettings.ROLLUP_ENABLED,
228+
XPackSettings.SNAPSHOT_LIFECYCLE_ENABLED,
229+
XPackSettings.SQL_ENABLED,
230+
XPackSettings.TRANSFORM_ENABLED,
231+
XPackSettings.VECTORS_ENABLED
232+
);
233+
234+
for (Setting<Boolean> deprecatedSetting : deprecatedXpackSettings) {
235+
final boolean value = randomBoolean();
236+
final Settings settings = Settings.builder().put(deprecatedSetting.getKey(), value).build();
237+
final PluginsAndModules pluginsAndModules = new PluginsAndModules(Collections.emptyList(), Collections.emptyList());
238+
final List<DeprecationIssue> issues =
239+
DeprecationChecks.filterChecks(DeprecationChecks.NODE_SETTINGS_CHECKS, c -> c.apply(settings, pluginsAndModules));
240+
final DeprecationIssue expected = new DeprecationIssue(
241+
DeprecationIssue.Level.CRITICAL,
242+
"setting [" + deprecatedSetting.getKey() + "] is deprecated and will be removed in the next major version",
243+
"https://www.elastic.co/guide/en/elasticsearch/reference/7.8/breaking-changes-7.8.html" +
244+
"#deprecate-basic-license-feature-enabled",
245+
"the setting [" + deprecatedSetting.getKey() + "] is currently set to [" + value + "], remove this setting"
246+
);
247+
assertThat(issues, contains(expected));
248+
assertSettingDeprecationsAndWarnings(new Setting<?>[]{deprecatedSetting});
249+
}
250+
}
251+
218252
public void testRemovedSettingNotSet() {
219253
final Settings settings = Settings.EMPTY;
220254
final Setting<?> removedSetting = Setting.simpleString("node.removed_setting");

0 commit comments

Comments
 (0)