diff --git a/docs/build.gradle b/docs/build.gradle index 7f490e7de81e6..91c6cbb3ba3ef 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -54,10 +54,6 @@ testClusters.matching { it.name == "integTest"}.configureEach { if (singleNode().testDistribution == DEFAULT) { setting 'xpack.license.self_generated.type', 'trial' setting 'indices.lifecycle.history_index_enabled', 'false' - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.autoscaling_feature_flag_registered', 'true' - } - setting 'xpack.autoscaling.enabled', 'true' systemProperty 'es.rollup_v2_feature_flag_enabled', 'true' keystorePassword 's3cr3t' } diff --git a/docs/reference/autoscaling/apis/autoscaling-apis.asciidoc b/docs/reference/autoscaling/apis/autoscaling-apis.asciidoc index f153d93decfa7..2dd765e746682 100644 --- a/docs/reference/autoscaling/apis/autoscaling-apis.asciidoc +++ b/docs/reference/autoscaling/apis/autoscaling-apis.asciidoc @@ -3,6 +3,8 @@ [[autoscaling-apis]] == Autoscaling APIs +experimental[] + You can use the following APIs to perform autoscaling operations. [discrete] diff --git a/docs/reference/autoscaling/apis/delete-autoscaling-policy.asciidoc b/docs/reference/autoscaling/apis/delete-autoscaling-policy.asciidoc index 5f06c85587c78..1bcf2a0d935a8 100644 --- a/docs/reference/autoscaling/apis/delete-autoscaling-policy.asciidoc +++ b/docs/reference/autoscaling/apis/delete-autoscaling-policy.asciidoc @@ -6,6 +6,8 @@ Delete autoscaling policy ++++ +experimental[] + Delete autoscaling policy. [[autoscaling-delete-autoscaling-policy-request]] diff --git a/docs/reference/autoscaling/apis/get-autoscaling-capacity.asciidoc b/docs/reference/autoscaling/apis/get-autoscaling-capacity.asciidoc index 24331bbe8b83e..ae359fd81d220 100644 --- a/docs/reference/autoscaling/apis/get-autoscaling-capacity.asciidoc +++ b/docs/reference/autoscaling/apis/get-autoscaling-capacity.asciidoc @@ -6,6 +6,8 @@ Get autoscaling capacity ++++ +experimental[] + Get autoscaling capacity. [[autoscaling-get-autoscaling-capacity-request]] diff --git a/docs/reference/autoscaling/apis/get-autoscaling-policy.asciidoc b/docs/reference/autoscaling/apis/get-autoscaling-policy.asciidoc index d78528ad37860..6ca04f3ab6f3b 100644 --- a/docs/reference/autoscaling/apis/get-autoscaling-policy.asciidoc +++ b/docs/reference/autoscaling/apis/get-autoscaling-policy.asciidoc @@ -6,6 +6,8 @@ Get autoscaling policy ++++ +experimental[] + Get autoscaling policy. [[autoscaling-get-autoscaling-policy-request]] diff --git a/docs/reference/autoscaling/apis/put-autoscaling-policy.asciidoc b/docs/reference/autoscaling/apis/put-autoscaling-policy.asciidoc index 30418489570e6..9131983715e6c 100644 --- a/docs/reference/autoscaling/apis/put-autoscaling-policy.asciidoc +++ b/docs/reference/autoscaling/apis/put-autoscaling-policy.asciidoc @@ -6,6 +6,8 @@ Put autoscaling policy ++++ +experimental[] + Put autoscaling policy. [[autoscaling-put-autoscaling-policy-request]] diff --git a/docs/reference/index.asciidoc b/docs/reference/index.asciidoc index 1e39636c3192b..1c1c19cedc57c 100644 --- a/docs/reference/index.asciidoc +++ b/docs/reference/index.asciidoc @@ -48,12 +48,8 @@ include::data-management.asciidoc[] include::ilm/index.asciidoc[] -ifdef::permanently-unreleased-branch[] - include::autoscaling/index.asciidoc[] -endif::[] - include::monitoring/index.asciidoc[] include::frozen-indices.asciidoc[] diff --git a/docs/reference/rest-api/index.asciidoc b/docs/reference/rest-api/index.asciidoc index 0b2e839888d76..24771051bd741 100644 --- a/docs/reference/rest-api/index.asciidoc +++ b/docs/reference/rest-api/index.asciidoc @@ -11,9 +11,7 @@ We are working on including more {es} APIs in this section. Some content might not be included yet. * <> -ifdef::permanently-unreleased-branch[] * <> -endif::[] * <> * <> * <> @@ -43,9 +41,7 @@ endif::[] -- include::{es-repo-dir}/api-conventions.asciidoc[] -ifdef::permanently-unreleased-branch[] include::{es-repo-dir}/autoscaling/apis/autoscaling-apis.asciidoc[] -endif::[] include::{es-repo-dir}/cat.asciidoc[] include::{es-repo-dir}/cluster.asciidoc[] include::{es-repo-dir}/ccr/apis/ccr-apis.asciidoc[] diff --git a/x-pack/plugin/autoscaling/build.gradle b/x-pack/plugin/autoscaling/build.gradle index 12b91ded97eba..b8cadf5b2c9ab 100644 --- a/x-pack/plugin/autoscaling/build.gradle +++ b/x-pack/plugin/autoscaling/build.gradle @@ -12,15 +12,9 @@ esplugin { } archivesBaseName = 'x-pack-autoscaling' -tasks.named('internalClusterTest').configure { - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.autoscaling_feature_flag_registered', 'true' - } -} - dependencies { compileOnly project(path: xpackModule('core'), configuration: 'default') testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') } -addQaCheckDependencies() \ No newline at end of file +addQaCheckDependencies() diff --git a/x-pack/plugin/autoscaling/qa/rest/build.gradle b/x-pack/plugin/autoscaling/qa/rest/build.gradle index bdfa4886ab961..ccd276b45a7e7 100644 --- a/x-pack/plugin/autoscaling/qa/rest/build.gradle +++ b/x-pack/plugin/autoscaling/qa/rest/build.gradle @@ -15,10 +15,6 @@ restResources { testClusters.all { testDistribution = 'DEFAULT' - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.autoscaling_feature_flag_registered', 'true' - } - setting 'xpack.autoscaling.enabled', 'true' setting 'xpack.security.enabled', 'true' extraConfigFile 'roles.yml', file('autoscaling-roles.yml') user username: 'autoscaling-admin', password: 'autoscaling-admin-password', role: 'superuser' diff --git a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/AutoscalingIntegTestCase.java b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/AutoscalingIntegTestCase.java index 359f806900329..84dbb0f3b6937 100644 --- a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/AutoscalingIntegTestCase.java +++ b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/AutoscalingIntegTestCase.java @@ -6,7 +6,6 @@ package org.elasticsearch.xpack.autoscaling; -import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; @@ -19,12 +18,4 @@ public abstract class AutoscalingIntegTestCase extends ESIntegTestCase { protected Collection> nodePlugins() { return List.of(LocalStateAutoscaling.class); } - - @Override - protected Settings nodeSettings(final int nodeOrdinal) { - final Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal)); - builder.put(Autoscaling.AUTOSCALING_ENABLED_SETTING.getKey(), true); - return builder.build(); - } - } diff --git a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageIT.java b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageIT.java index af27aa2b2f68b..a441bb50d4c96 100644 --- a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageIT.java +++ b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageIT.java @@ -20,7 +20,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; -import org.elasticsearch.xpack.autoscaling.Autoscaling; import org.elasticsearch.xpack.autoscaling.LocalStateAutoscaling; import org.elasticsearch.xpack.autoscaling.action.GetAutoscalingCapacityAction; import org.elasticsearch.xpack.autoscaling.action.PutAutoscalingPolicyAction; @@ -55,8 +54,7 @@ protected Collection> nodePlugins() { @Override protected Settings nodeSettings(final int nodeOrdinal) { final Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal)); - builder.put(Autoscaling.AUTOSCALING_ENABLED_SETTING.getKey(), true) - .put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey(), (WATERMARK_BYTES * 2) + "b") + builder.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey(), (WATERMARK_BYTES * 2) + "b") .put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey(), WATERMARK_BYTES + "b") .put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_WATERMARK_SETTING.getKey(), "0b") .put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_REROUTE_INTERVAL_SETTING.getKey(), "0ms") diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java index 07ffbe50c1445..482db005a07e4 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.autoscaling; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.Build; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.client.Client; @@ -21,7 +20,6 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.IndexScopedSettings; -import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.xcontent.NamedXContentRegistry; @@ -68,61 +66,21 @@ */ public class Autoscaling extends Plugin implements ActionPlugin, ExtensiblePlugin, AutoscalingExtension { - private static final Boolean AUTOSCALING_FEATURE_FLAG_REGISTERED; - static { final String property = System.getProperty("es.autoscaling_feature_flag_registered"); - if (Build.CURRENT.isSnapshot() && property != null) { - throw new IllegalArgumentException("es.autoscaling_feature_flag_registered is only supported in non-snapshot builds"); - } - if ("true".equals(property)) { - AUTOSCALING_FEATURE_FLAG_REGISTERED = true; - } else if ("false".equals(property)) { - AUTOSCALING_FEATURE_FLAG_REGISTERED = false; - } else if (property == null) { - AUTOSCALING_FEATURE_FLAG_REGISTERED = null; - } else { - throw new IllegalArgumentException( - "expected es.autoscaling_feature_flag_registered to be unset or [true|false] but was [" + property + "]" - ); + if (property != null) { + throw new IllegalArgumentException("es.autoscaling_feature_flag_registered is no longer supported"); } } - public static final Setting AUTOSCALING_ENABLED_SETTING = Setting.boolSetting( - "xpack.autoscaling.enabled", - true, - Setting.Property.NodeScope - ); - - private final boolean enabled; - private final List autoscalingExtensions; private final SetOnce clusterService = new SetOnce<>(); private final SetOnce allocationDeciders = new SetOnce<>(); - public Autoscaling(final Settings settings) { - this.enabled = AUTOSCALING_ENABLED_SETTING.get(settings); + public Autoscaling() { this.autoscalingExtensions = new ArrayList<>(List.of(this)); } - /** - * The settings defined by autoscaling. - * - * @return the settings - */ - @Override - public List> getSettings() { - if (isSnapshot() || (AUTOSCALING_FEATURE_FLAG_REGISTERED != null && AUTOSCALING_FEATURE_FLAG_REGISTERED)) { - return List.of(AUTOSCALING_ENABLED_SETTING); - } else { - return List.of(); - } - } - - boolean isSnapshot() { - return Build.CURRENT.isSnapshot(); - } - @Override public Collection createComponents( Client client, @@ -143,16 +101,12 @@ public Collection createComponents( @Override public List> getActions() { - if (enabled) { - return List.of( - new ActionHandler<>(GetAutoscalingCapacityAction.INSTANCE, TransportGetAutoscalingCapacityAction.class), - new ActionHandler<>(DeleteAutoscalingPolicyAction.INSTANCE, TransportDeleteAutoscalingPolicyAction.class), - new ActionHandler<>(GetAutoscalingPolicyAction.INSTANCE, TransportGetAutoscalingPolicyAction.class), - new ActionHandler<>(PutAutoscalingPolicyAction.INSTANCE, TransportPutAutoscalingPolicyAction.class) - ); - } else { - return List.of(); - } + return List.of( + new ActionHandler<>(GetAutoscalingCapacityAction.INSTANCE, TransportGetAutoscalingCapacityAction.class), + new ActionHandler<>(DeleteAutoscalingPolicyAction.INSTANCE, TransportDeleteAutoscalingPolicyAction.class), + new ActionHandler<>(GetAutoscalingPolicyAction.INSTANCE, TransportGetAutoscalingPolicyAction.class), + new ActionHandler<>(PutAutoscalingPolicyAction.INSTANCE, TransportPutAutoscalingPolicyAction.class) + ); } @Override @@ -165,16 +119,12 @@ public List getRestHandlers( final IndexNameExpressionResolver indexNameExpressionResolver, final Supplier nodesInCluster ) { - if (enabled) { - return List.of( - new RestGetAutoscalingCapacityHandler(), - new RestDeleteAutoscalingPolicyHandler(), - new RestGetAutoscalingPolicyHandler(), - new RestPutAutoscalingPolicyHandler() - ); - } else { - return List.of(); - } + return List.of( + new RestGetAutoscalingCapacityHandler(), + new RestDeleteAutoscalingPolicyHandler(), + new RestGetAutoscalingPolicyHandler(), + new RestPutAutoscalingPolicyHandler() + ); } @Override diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingTestCase.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingTestCase.java index 0e9f33e9fdbec..36dfa65dc1b45 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingTestCase.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingTestCase.java @@ -190,10 +190,10 @@ public static SortedSet randomRoles() { } public static NamedWriteableRegistry getAutoscalingNamedWriteableRegistry() { - return new NamedWriteableRegistry(new Autoscaling(Settings.EMPTY).getNamedWriteables()); + return new NamedWriteableRegistry(new Autoscaling().getNamedWriteables()); } public static NamedXContentRegistry getAutoscalingXContentRegistry() { - return new NamedXContentRegistry(new Autoscaling(Settings.EMPTY).getNamedXContent()); + return new NamedXContentRegistry(new Autoscaling().getNamedXContent()); } } diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingTests.java deleted file mode 100644 index 09aeb6a7e1850..0000000000000 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingTests.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -package org.elasticsearch.xpack.autoscaling; - -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.ESTestCase; - -import static org.hamcrest.Matchers.hasItem; -import static org.hamcrest.Matchers.not; - -public class AutoscalingTests extends ESTestCase { - - public void testEnabledSettingRegisteredInSnapshotBuilds() { - final Autoscaling plugin = new Autoscaling(Settings.EMPTY) { - - @Override - protected boolean isSnapshot() { - return true; - } - - }; - assertThat(plugin.getSettings(), hasItem(Autoscaling.AUTOSCALING_ENABLED_SETTING)); - } - - public void testEnabledSettingNotRegisteredInNonSnapshotBuilds() { - final Autoscaling plugin = new Autoscaling(Settings.EMPTY) { - - @Override - protected boolean isSnapshot() { - return false; - } - - }; - assertThat(plugin.getSettings(), not(hasItem(Autoscaling.AUTOSCALING_ENABLED_SETTING))); - } - -} diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/LocalStateAutoscaling.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/LocalStateAutoscaling.java index dbd23669aa9c8..6d2efb50a9f16 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/LocalStateAutoscaling.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/LocalStateAutoscaling.java @@ -14,7 +14,7 @@ public class LocalStateAutoscaling extends LocalStateCompositeXPackPlugin { public LocalStateAutoscaling(final Settings settings) { super(settings, null); - plugins.add(new Autoscaling(settings) { + plugins.add(new Autoscaling() { @Override protected XPackLicenseState getLicenseState() { diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle index b20cbfed485a2..16cf78d8eb35f 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle @@ -38,9 +38,6 @@ testClusters.all { numberOfNodes = 3 testDistribution = 'DEFAULT' - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.autoscaling_feature_flag_registered', 'true' - } setting 'xpack.security.enabled', 'true' setting 'xpack.monitoring.elasticsearch.collection.enabled', 'false' setting 'xpack.ml.enabled', 'true'