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 <debadair@elastic.co>
This commit is contained in:
William Brafford 2020-05-07 10:28:17 -04:00 committed by GitHub
parent b5e385fa56
commit 691044e67b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 91 additions and 26 deletions

View File

@ -288,28 +288,3 @@ still be adjusted as desired using the cluster settings API.
==== HTTP Max content length setting is no longer parsed leniently
Previously, `http.max_content_length` would reset to `100mb` if the setting was
greater than `Integer.MAX_VALUE`. This leniency has been removed.
[float]
==== Option to disable basic license features is deprecated
In Elasticsearch 7.8.0, the following settings no longer have any effect, and
have been deprecated:
* `xpack.enrich.enabled`
* `xpack.flattened.enabled`
* `xpack.ilm.enabled`
* `xpack.monitoring.enabled`
* `xpack.rollup.enabled`
* `xpack.slm.enabled`
* `xpack.sql.enabled`
* `xpack.transform.enabled`
* `xpack.vectors.enabled`
Previously, these settings could be set to `false` in order to disable the
feature's APIs in a cluster. As of 7.8.0, these basic license features are
always enabled for the {default-dist}.
If you have disabled ILM so that you can use another tool to manage Watcher
indices, the newly introduced `xpack.watcher.use_ilm_index_management` setting
may be set to false.

View File

@ -92,6 +92,35 @@ To avoid deprecation warnings, discontinue use of the `node.local_storage`
setting.
====
[[deprecate-basic-license-feature-enabled]]
.Several {xpack} settings no longer have any effect and are deprecated.
[%collapsible]
====
*Details* +
Basic {xpack} license features are always enabled for the {default-dist}
and the following settings no longer have any effect:
* `xpack.enrich.enabled`
* `xpack.flattened.enabled`
* `xpack.ilm.enabled`
* `xpack.monitoring.enabled`
* `xpack.rollup.enabled`
* `xpack.slm.enabled`
* `xpack.sql.enabled`
* `xpack.transform.enabled`
* `xpack.vectors.enabled`
Previously, they could be set to `false` to disable the feature's APIs in a cluster.
*Impact* +
To avoid deprecation warnings, discontinue use of these settings.
If you have disabled ILM so that you can use another tool to manage Watcher
indices, the newly introduced `xpack.watcher.use_ilm_index_management` setting
may be set to false.
====
[float]
[[builtin-users-changes]]
==== Changes to built-in users

View File

@ -10,6 +10,7 @@ import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.xpack.core.XPackSettings;
import org.elasticsearch.xpack.core.deprecation.DeprecationInfoAction;
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig;
@ -49,7 +50,25 @@ public class DeprecationChecks {
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkThreadPoolListenerQueueSize(settings),
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkThreadPoolListenerSize(settings),
NodeDeprecationChecks::checkClusterRemoteConnectSetting,
NodeDeprecationChecks::checkNodeLocalStorageSetting
NodeDeprecationChecks::checkNodeLocalStorageSetting,
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
XPackSettings.ENRICH_ENABLED_SETTING),
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
XPackSettings.FLATTENED_ENABLED),
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
XPackSettings.INDEX_LIFECYCLE_ENABLED),
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
XPackSettings.MONITORING_ENABLED),
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
XPackSettings.ROLLUP_ENABLED),
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
XPackSettings.SNAPSHOT_LIFECYCLE_ENABLED),
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
XPackSettings.SQL_ENABLED),
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
XPackSettings.TRANSFORM_ENABLED),
(settings, pluginsAndModules) -> NodeDeprecationChecks.checkNodeBasicLicenseFeatureEnabledSetting(settings,
XPackSettings.VECTORS_ENABLED)
));
static List<Function<IndexMetadata, DeprecationIssue>> INDEX_SETTINGS_CHECKS =

View File

@ -137,6 +137,14 @@ class NodeDeprecationChecks {
);
}
public static DeprecationIssue checkNodeBasicLicenseFeatureEnabledSetting(final Settings settings, Setting<?> setting) {
return checkRemovedSetting(
settings,
setting,
"https://www.elastic.co/guide/en/elasticsearch/reference/7.8/breaking-changes-7.8.html#deprecate-basic-license-feature-enabled"
);
}
private static DeprecationIssue checkDeprecatedSetting(
final Settings settings,
final PluginsAndModules pluginsAndModules,

View File

@ -7,6 +7,7 @@
package org.elasticsearch.xpack.deprecation;
import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules;
import org.elasticsearch.common.collect.Set;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.EsExecutors;
@ -14,10 +15,12 @@ import org.elasticsearch.env.Environment;
import org.elasticsearch.node.Node;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.transport.RemoteClusterService;
import org.elasticsearch.xpack.core.XPackSettings;
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
import org.elasticsearch.xpack.core.security.authc.RealmConfig;
import org.elasticsearch.xpack.core.security.authc.RealmSettings;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
@ -215,6 +218,37 @@ public class NodeDeprecationChecksTests extends ESTestCase {
assertSettingDeprecationsAndWarnings(new Setting<?>[]{Node.NODE_LOCAL_STORAGE_SETTING});
}
public void testDeprecatedBasicLicenseSettings() {
Collection<Setting<Boolean>> deprecatedXpackSettings = Set.of(
XPackSettings.ENRICH_ENABLED_SETTING,
XPackSettings.FLATTENED_ENABLED,
XPackSettings.INDEX_LIFECYCLE_ENABLED,
XPackSettings.MONITORING_ENABLED,
XPackSettings.ROLLUP_ENABLED,
XPackSettings.SNAPSHOT_LIFECYCLE_ENABLED,
XPackSettings.SQL_ENABLED,
XPackSettings.TRANSFORM_ENABLED,
XPackSettings.VECTORS_ENABLED
);
for (Setting<Boolean> deprecatedSetting : deprecatedXpackSettings) {
final boolean value = randomBoolean();
final Settings settings = Settings.builder().put(deprecatedSetting.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 [" + deprecatedSetting.getKey() + "] 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-basic-license-feature-enabled",
"the setting [" + deprecatedSetting.getKey() + "] is currently set to [" + value + "], remove this setting"
);
assertThat(issues, contains(expected));
assertSettingDeprecationsAndWarnings(new Setting<?>[]{deprecatedSetting});
}
}
public void testRemovedSettingNotSet() {
final Settings settings = Settings.EMPTY;
final Setting<?> removedSetting = Setting.simpleString("node.removed_setting");