From a0b7a674f94e67e35f89212a95aafdf3de6418e2 Mon Sep 17 00:00:00 2001 From: William Brafford Date: Mon, 4 May 2020 15:57:48 -0400 Subject: [PATCH] Remove deprecated settings from 8.0.0 --- .../migration/migrate_8_0/settings.asciidoc | 10 +- .../xpack/core/XPackSettings.java | 100 ------------------ .../elasticsearch/xpack/watcher/Watcher.java | 2 +- .../xpack/watcher/WatcherPluginTests.java | 19 ---- 4 files changed, 5 insertions(+), 126 deletions(-) diff --git a/docs/reference/migration/migrate_8_0/settings.asciidoc b/docs/reference/migration/migrate_8_0/settings.asciidoc index 5ac52665b31de..7e4797d9eff9b 100644 --- a/docs/reference/migration/migrate_8_0/settings.asciidoc +++ b/docs/reference/migration/migrate_8_0/settings.asciidoc @@ -67,10 +67,10 @@ In Elasticsearch 8.0.0, the setting `xpack.monitoring.exporters..a removed. [float] -==== Option to disable basic license features is deprecated +==== Option to disable basic license features is removed. -In Elasticsearch 7.8.0, the following settings no longer have any effect, and -have been deprecated: +The following settings were deprecated in {es} 7.8.0 and have been removed +in {es} 8.0.0: * `xpack.enrich.enabled` * `xpack.flattened.enabled` @@ -82,9 +82,7 @@ have been deprecated: * `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}. +These basic license features are now 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 diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackSettings.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackSettings.java index 2f20893149bc4..7a6290a9e3917 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackSettings.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackSettings.java @@ -37,41 +37,14 @@ private XPackSettings() { throw new IllegalStateException("Utility class should not be instantiated"); } - /** - * Setting for controlling whether or not enrich is enabled. - *

- * This setting is now a no-op: setting it to false is permitted, but does nothing. - */ - @Deprecated(since = "7.8.0") - public static final Setting ENRICH_ENABLED_SETTING = Setting.boolSetting("xpack.enrich.enabled", true, - Property.NodeScope, Property.Deprecated); - /** * Setting for controlling whether or not CCR is enabled. */ public static final Setting CCR_ENABLED_SETTING = Setting.boolSetting("xpack.ccr.enabled", true, Property.NodeScope); - /** - * Setting for enabling or disabling data frame. Defaults to true. - *

- * This setting is now a no-op: setting it to false is permitted, but does nothing. - */ - @Deprecated(since = "7.8.0") - public static final Setting TRANSFORM_ENABLED = Setting.boolSetting("xpack.transform.enabled", true, - Property.NodeScope, Property.Deprecated); - /** Setting for enabling or disabling security. Defaults to true. */ public static final Setting SECURITY_ENABLED = Setting.boolSetting("xpack.security.enabled", true, Setting.Property.NodeScope); - /** - * Setting for enabling or disabling monitoring. - *

- * This setting is now a no-op: setting it to false is permitted, but does nothing. - */ - @Deprecated(since = "7.8.0") - public static final Setting MONITORING_ENABLED = Setting.boolSetting("xpack.monitoring.enabled", true, - Property.NodeScope, Property.Deprecated); - /** Setting for enabling or disabling watcher. Defaults to true. */ public static final Setting WATCHER_ENABLED = Setting.boolSetting("xpack.watcher.enabled", true, Setting.Property.NodeScope); @@ -82,15 +55,6 @@ private XPackSettings() { public static final Setting MACHINE_LEARNING_ENABLED = Setting.boolSetting("xpack.ml.enabled", true, Setting.Property.NodeScope); - /** - * Setting for enabling or disabling rollup. Defaults to true. - *

- * This setting is now a no-op: setting it to false is permitted, but does nothing. - */ - @Deprecated(since = "7.8.0") - public static final Setting ROLLUP_ENABLED = Setting.boolSetting("xpack.rollup.enabled", true, - Property.NodeScope, Property.Deprecated); - /** Setting for enabling or disabling auditing. Defaults to false. */ public static final Setting AUDIT_ENABLED = Setting.boolSetting("xpack.security.audit.enabled", false, Setting.Property.NodeScope); @@ -99,33 +63,6 @@ private XPackSettings() { public static final Setting DLS_FLS_ENABLED = Setting.boolSetting("xpack.security.dls_fls.enabled", true, Setting.Property.NodeScope); - /** - * Setting for enabling or disabling Logstash extensions. Defaults to true. - *

- * This setting is now a no-op: setting it to false is permitted, but does nothing. - */ - @Deprecated(since = "7.8.0") - public static final Setting LOGSTASH_ENABLED = Setting.boolSetting("xpack.logstash.enabled", true, - Setting.Property.NodeScope, Property.Deprecated); - - /** - * Setting for enabling or disabling the index lifecycle extension. Defaults to true. - *

- * This setting is now a no-op: setting it to false is permitted, but does nothing. - */ - @Deprecated(since = "7.8.0") - public static final Setting INDEX_LIFECYCLE_ENABLED = Setting.boolSetting("xpack.ilm.enabled", true, - Property.NodeScope, Property.Deprecated); - - /** - * Setting for enabling or disabling the snapshot lifecycle extension. Defaults to true. - *

- * This setting is now a no-op: setting it to false is permitted, but does nothing. - */ - @Deprecated(since = "7.8.0") - public static final Setting SNAPSHOT_LIFECYCLE_ENABLED = Setting.boolSetting("xpack.slm.enabled", true, - Property.NodeScope, Property.Deprecated); - /** Setting for enabling or disabling TLS. Defaults to false. */ public static final Setting TRANSPORT_SSL_ENABLED = Setting.boolSetting("xpack.security.transport.ssl.enabled", false, Property.NodeScope); @@ -150,33 +87,6 @@ private XPackSettings() { public static final Setting FIPS_MODE_ENABLED = Setting.boolSetting("xpack.security.fips_mode.enabled", false, Property.NodeScope); - /** - * Setting for enabling or disabling sql. Defaults to true. - *

- * This setting is now a no-op: setting it to false is permitted, but does nothing. - */ - @Deprecated(since = "7.8.0") - public static final Setting SQL_ENABLED = Setting.boolSetting("xpack.sql.enabled", true, - Property.NodeScope, Property.Deprecated); - - /** - * Setting for enabling or disabling flattened fields. Defaults to true. - *

- * This setting is now a no-op: setting it to false is permitted, but does nothing. - */ - @Deprecated(since = "7.8.0") - public static final Setting FLATTENED_ENABLED = Setting.boolSetting("xpack.flattened.enabled", true, - Property.NodeScope, Property.Deprecated); - - /** - * Setting for enabling or disabling vectors. Defaults to true. - *

- * This setting is now a no-op: setting it to false is permitted, but does nothing. - */ - @Deprecated(since = "7.8.0") - public static final Setting VECTORS_ENABLED = Setting.boolSetting("xpack.vectors.enabled", true, - Property.NodeScope, Property.Deprecated); - /* * SSL settings. These are the settings that are specifically registered for SSL. Many are private as we do not explicitly use them * but instead parse based on a prefix (eg *.ssl.*) @@ -271,28 +181,18 @@ public static List> getAllSettings() { settings.addAll(HTTP_SSL.getAllSettings()); settings.addAll(TRANSPORT_SSL.getAllSettings()); settings.add(SECURITY_ENABLED); - settings.add(MONITORING_ENABLED); settings.add(GRAPH_ENABLED); settings.add(MACHINE_LEARNING_ENABLED); settings.add(AUDIT_ENABLED); settings.add(WATCHER_ENABLED); settings.add(DLS_FLS_ENABLED); - settings.add(LOGSTASH_ENABLED); settings.add(TRANSPORT_SSL_ENABLED); settings.add(HTTP_SSL_ENABLED); settings.add(RESERVED_REALM_ENABLED_SETTING); settings.add(TOKEN_SERVICE_ENABLED_SETTING); settings.add(API_KEY_SERVICE_ENABLED_SETTING); - settings.add(SQL_ENABLED); settings.add(USER_SETTING); - settings.add(ROLLUP_ENABLED); settings.add(PASSWORD_HASHING_ALGORITHM); - settings.add(INDEX_LIFECYCLE_ENABLED); - settings.add(SNAPSHOT_LIFECYCLE_ENABLED); - settings.add(TRANSFORM_ENABLED); - settings.add(FLATTENED_ENABLED); - settings.add(VECTORS_ENABLED); - settings.add(ENRICH_ENABLED_SETTING); return Collections.unmodifiableList(settings); } diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java index 7e1e37aa85364..96cf38028be0b 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java @@ -211,7 +211,7 @@ public class Watcher extends Plugin implements SystemIndexPlugin, ScriptPlugin, public static final Setting MAX_STOP_TIMEOUT_SETTING = Setting.timeSetting("xpack.watcher.stop.timeout", TimeValue.timeValueSeconds(30), Setting.Property.NodeScope); public static final Setting USE_ILM_INDEX_MANAGEMENT = - Setting.boolSetting("xpack.watcher.use_ilm_index_management", XPackSettings.INDEX_LIFECYCLE_ENABLED, NodeScope); + Setting.boolSetting("xpack.watcher.use_ilm_index_management", true, NodeScope); private static final Setting SETTING_BULK_ACTIONS = Setting.intSetting("xpack.watcher.bulk.actions", 1, 1, 10000, NodeScope); private static final Setting SETTING_BULK_CONCURRENT_REQUESTS = diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherPluginTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherPluginTests.java index 8ee55ea208997..4eaeb2a8ea65e 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherPluginTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherPluginTests.java @@ -6,7 +6,6 @@ package org.elasticsearch.xpack.watcher; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.index.IndexModule; @@ -16,7 +15,6 @@ import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.IndexSettingsModule; import org.elasticsearch.threadpool.ExecutorBuilder; -import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.watcher.watch.Watch; import org.elasticsearch.xpack.watcher.notification.NotificationService; @@ -88,23 +86,6 @@ public void testWatcherDisabledTests() throws Exception { watcher.close(); } - public void testWatcherUseIlmFallsBackToIlmEnabled() throws Exception { - boolean ilmEnabled = randomBoolean(); - Settings settingsWithoutWatcherUseIlm = Settings.builder() - .put(XPackSettings.INDEX_LIFECYCLE_ENABLED.getKey(), ilmEnabled) - .build(); - assertThat(Watcher.USE_ILM_INDEX_MANAGEMENT.get(settingsWithoutWatcherUseIlm), is(ilmEnabled)); - - boolean watcherUseIlmEnabled = randomBoolean(); - Settings settingsWithWatcherUseIlm = Settings.builder() - .put(XPackSettings.INDEX_LIFECYCLE_ENABLED.getKey(), ilmEnabled) - .put(Watcher.USE_ILM_INDEX_MANAGEMENT.getKey(), watcherUseIlmEnabled) - .build(); - assertThat(Watcher.USE_ILM_INDEX_MANAGEMENT.get(settingsWithWatcherUseIlm), is(watcherUseIlmEnabled)); - - assertSettingDeprecationsAndWarnings(new Setting[] { XPackSettings.INDEX_LIFECYCLE_ENABLED } ); - } - public void testThreadPoolSize() { // old calculation was 5 * number of processors assertThat(Watcher.getWatcherThreadPoolSize(true, 1), is(5));