diff --git a/docs/reference/migration/migrate_7_8.asciidoc b/docs/reference/migration/migrate_7_8.asciidoc
index bf5bdc9e535..ec79eac7659 100644
--- a/docs/reference/migration/migrate_7_8.asciidoc
+++ b/docs/reference/migration/migrate_7_8.asciidoc
@@ -94,30 +94,26 @@ setting.
[[deprecate-basic-license-feature-enabled]]
-.Several {xpack} settings no longer have any effect and are deprecated.
+.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:
+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.
-The ILM and SLM settings have been deprecated, but still have the effect of disabling
-their respective APIs:
-
-* `xpack.ilm.enabled`
-* `xpack.slm.enabled`
-
*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
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 4cb5336342f..57539e27366 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
@@ -118,6 +118,8 @@ public class XPackSettings {
/**
* 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,
@@ -125,6 +127,8 @@ public class XPackSettings {
/**
* 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,
diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java
index c651c93e827..6ea43825a30 100644
--- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java
+++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java
@@ -49,12 +49,12 @@ public class IndexLifecycleFeatureSetUsage extends XPackFeatureSet.Usage {
}
}
- public IndexLifecycleFeatureSetUsage(boolean available, boolean enabled) {
- this(available, enabled, null);
+ public IndexLifecycleFeatureSetUsage(boolean available) {
+ this(available, null);
}
- public IndexLifecycleFeatureSetUsage(boolean available, boolean enabled, List policyStats) {
- super(XPackField.INDEX_LIFECYCLE, available, enabled);
+ public IndexLifecycleFeatureSetUsage(boolean available, List policyStats) {
+ super(XPackField.INDEX_LIFECYCLE, available, true);
this.policyStats = policyStats;
}
diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SLMFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SLMFeatureSetUsage.java
index 42048086cea..b0cf3059207 100644
--- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SLMFeatureSetUsage.java
+++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SLMFeatureSetUsage.java
@@ -33,8 +33,8 @@ public class SLMFeatureSetUsage extends XPackFeatureSet.Usage {
out.writeOptionalWriteable(this.slmStats);
}
- public SLMFeatureSetUsage(boolean available, boolean enabled, @Nullable SnapshotLifecycleStats slmStats) {
- super(XPackField.SNAPSHOT_LIFECYCLE, available, enabled);
+ public SLMFeatureSetUsage(boolean available, @Nullable SnapshotLifecycleStats slmStats) {
+ super(XPackField.SNAPSHOT_LIFECYCLE, available, true);
this.slmStats = slmStats;
}
diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistry.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistry.java
index c568efcb8f8..33ad3aca2e8 100644
--- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistry.java
+++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistry.java
@@ -26,7 +26,6 @@ import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.gateway.GatewayService;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.xpack.core.XPackClient;
-import org.elasticsearch.xpack.core.XPackSettings;
import org.elasticsearch.xpack.core.ilm.IndexLifecycleMetadata;
import org.elasticsearch.xpack.core.ilm.LifecyclePolicy;
import org.elasticsearch.xpack.core.ilm.action.PutLifecycleAction;
@@ -203,29 +202,26 @@ public abstract class IndexTemplateRegistry implements ClusterStateListener {
}
private void addIndexLifecyclePoliciesIfMissing(ClusterState state) {
- boolean ilmSupported = XPackSettings.INDEX_LIFECYCLE_ENABLED.get(settings);
- if (ilmSupported) {
- Optional maybeMeta = Optional.ofNullable(state.metadata().custom(IndexLifecycleMetadata.TYPE));
- List policies = getPolicyConfigs().stream()
- .map(policyConfig -> policyConfig.load(xContentRegistry))
- .collect(Collectors.toList());
+ Optional maybeMeta = Optional.ofNullable(state.metadata().custom(IndexLifecycleMetadata.TYPE));
+ List policies = getPolicyConfigs().stream()
+ .map(policyConfig -> policyConfig.load(xContentRegistry))
+ .collect(Collectors.toList());
- for (LifecyclePolicy policy : policies) {
- final AtomicBoolean creationCheck = policyCreationsInProgress.computeIfAbsent(policy.getName(),
- key -> new AtomicBoolean(false));
- if (creationCheck.compareAndSet(false, true)) {
- final boolean policyNeedsToBeCreated = maybeMeta
- .flatMap(ilmMeta -> Optional.ofNullable(ilmMeta.getPolicies().get(policy.getName())))
- .isPresent() == false;
- if (policyNeedsToBeCreated) {
- logger.debug("adding lifecycle policy [{}] for [{}], because it doesn't exist", policy.getName(), getOrigin());
- putPolicy(policy, creationCheck);
- } else {
- logger.trace("not adding lifecycle policy [{}] for [{}], because it already exists",
- policy.getName(), getOrigin());
- creationCheck.set(false);
- }
+ for (LifecyclePolicy policy : policies) {
+ final AtomicBoolean creationCheck = policyCreationsInProgress.computeIfAbsent(policy.getName(),
+ key -> new AtomicBoolean(false));
+ if (creationCheck.compareAndSet(false, true)) {
+ final boolean policyNeedsToBeCreated = maybeMeta
+ .flatMap(ilmMeta -> Optional.ofNullable(ilmMeta.getPolicies().get(policy.getName())))
+ .isPresent() == false;
+ if (policyNeedsToBeCreated) {
+ logger.debug("adding lifecycle policy [{}] for [{}], because it doesn't exist", policy.getName(), getOrigin());
+ putPolicy(policy, creationCheck);
+ } else {
+ logger.trace("not adding lifecycle policy [{}] for [{}], because it already exists",
+ policy.getName(), getOrigin());
+ creationCheck.set(false);
}
}
}
diff --git a/x-pack/plugin/core/src/main/resources/org/elasticsearch/xpack/core/ml/anomalydetection/state_index_template.json b/x-pack/plugin/core/src/main/resources/org/elasticsearch/xpack/core/ml/anomalydetection/state_index_template.json
index e3cd7f51dc4..64635b658e3 100644
--- a/x-pack/plugin/core/src/main/resources/org/elasticsearch/xpack/core/ml/anomalydetection/state_index_template.json
+++ b/x-pack/plugin/core/src/main/resources/org/elasticsearch/xpack/core/ml/anomalydetection/state_index_template.json
@@ -8,8 +8,9 @@
"index" : {
"auto_expand_replicas" : "0-1",
"hidden": true
- }
- ${xpack.ml.index.lifecycle.settings}
+ },
+ "index.lifecycle.name": "${xpack.ml.index.lifecycle.name}",
+ "index.lifecycle.rollover_alias": "${xpack.ml.index.lifecycle.rollover_alias}"
},
"mappings" : {
"_doc": {
diff --git a/x-pack/plugin/core/src/main/resources/org/elasticsearch/xpack/core/ml/stats_index_template.json b/x-pack/plugin/core/src/main/resources/org/elasticsearch/xpack/core/ml/stats_index_template.json
index 223d1a79bad..b7df779b7a6 100644
--- a/x-pack/plugin/core/src/main/resources/org/elasticsearch/xpack/core/ml/stats_index_template.json
+++ b/x-pack/plugin/core/src/main/resources/org/elasticsearch/xpack/core/ml/stats_index_template.json
@@ -9,8 +9,9 @@
"number_of_shards" : "1",
"auto_expand_replicas" : "0-1",
"hidden": true
- }
- ${xpack.ml.index.lifecycle.settings}
+ },
+ "index.lifecycle.name": "${xpack.ml.index.lifecycle.name}",
+ "index.lifecycle.rollover_alias": "${xpack.ml.index.lifecycle.rollover_alias}"
},
"mappings" : ${xpack.ml.stats.mappings},
"aliases" : {}
diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsageTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsageTests.java
index 659cb4ed8cd..0c99137481e 100644
--- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsageTests.java
+++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsageTests.java
@@ -28,22 +28,18 @@ public class IndexLifecycleFeatureSetUsageTests extends AbstractWireSerializingT
policyStats.add(PolicyStatsTests.createRandomInstance());
}
}
- return new IndexLifecycleFeatureSetUsage(available, enabled, policyStats);
+ return new IndexLifecycleFeatureSetUsage(available, policyStats);
}
@Override
protected IndexLifecycleFeatureSetUsage mutateInstance(IndexLifecycleFeatureSetUsage instance) throws IOException {
boolean available = instance.available();
- boolean enabled = instance.enabled();
List policyStats = instance.getPolicyStats();
- switch (between(0, 2)) {
+ switch (between(0, 1)) {
case 0:
available = available == false;
break;
case 1:
- enabled = enabled == false;
- break;
- case 2:
if (policyStats == null) {
policyStats = new ArrayList<>();
policyStats.add(PolicyStatsTests.createRandomInstance());
@@ -57,7 +53,7 @@ public class IndexLifecycleFeatureSetUsageTests extends AbstractWireSerializingT
default:
throw new AssertionError("Illegal randomisation branch");
}
- return new IndexLifecycleFeatureSetUsage(available, enabled, policyStats);
+ return new IndexLifecycleFeatureSetUsage(available, policyStats);
}
@Override
diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycle.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycle.java
index ce2b58ec548..7e624d5f9d1 100644
--- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycle.java
+++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycle.java
@@ -38,7 +38,6 @@ import org.elasticsearch.script.ScriptService;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.elasticsearch.xpack.core.XPackPlugin;
-import org.elasticsearch.xpack.core.XPackSettings;
import org.elasticsearch.xpack.core.ilm.AllocateAction;
import org.elasticsearch.xpack.core.ilm.DeleteAction;
import org.elasticsearch.xpack.core.ilm.ForceMergeAction;
@@ -141,14 +140,10 @@ public class IndexLifecycle extends Plugin implements ActionPlugin {
private final SetOnce snapshotRetentionService = new SetOnce<>();
private final SetOnce snapshotHistoryStore = new SetOnce<>();
private Settings settings;
- private boolean ilmEnabled;
- private boolean slmEnabled;
private boolean transportClientMode;
public IndexLifecycle(Settings settings) {
this.settings = settings;
- this.ilmEnabled = XPackSettings.INDEX_LIFECYCLE_ENABLED.get(settings);
- this.slmEnabled = XPackSettings.SNAPSHOT_LIFECYCLE_ENABLED.get(settings);
this.transportClientMode = XPackPlugin.transportClientMode(settings);
}
@@ -197,31 +192,29 @@ public class IndexLifecycle extends Plugin implements ActionPlugin {
return Collections.emptyList();
}
final List