Skip to content

Commit 097d242

Browse files
Autoscaling remove feature flags (elastic#65973)
Removed the autoscaling feature flags, autoscaling is now on by default (though it requires an external system to handle the autoscaling events). Added experimental notice to all autoscaling related documentation pages. Relates elastic#51191
1 parent 279165d commit 097d242

File tree

17 files changed

+30
-141
lines changed

17 files changed

+30
-141
lines changed

docs/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ testClusters.integTest {
5454
if (singleNode().testDistribution == DEFAULT) {
5555
setting 'xpack.license.self_generated.type', 'trial'
5656
setting 'indices.lifecycle.history_index_enabled', 'false'
57-
if (BuildParams.isSnapshotBuild() == false) {
58-
systemProperty 'es.autoscaling_feature_flag_registered', 'true'
59-
}
60-
setting 'xpack.autoscaling.enabled', 'true'
6157
systemProperty 'es.rollup_v2_feature_flag_enabled', 'true'
6258
keystorePassword 's3cr3t'
6359
}

docs/reference/autoscaling/apis/autoscaling-apis.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
[[autoscaling-apis]]
44
== Autoscaling APIs
55

6+
experimental[]
7+
68
You can use the following APIs to perform autoscaling operations.
79

810
[discrete]

docs/reference/autoscaling/apis/delete-autoscaling-policy.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<titleabbrev>Delete autoscaling policy</titleabbrev>
77
++++
88

9+
experimental[]
10+
911
Delete autoscaling policy.
1012

1113
[[autoscaling-delete-autoscaling-policy-request]]

docs/reference/autoscaling/apis/get-autoscaling-capacity.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<titleabbrev>Get autoscaling capacity</titleabbrev>
77
++++
88

9+
experimental[]
10+
911
Get autoscaling capacity.
1012

1113
[[autoscaling-get-autoscaling-capacity-request]]

docs/reference/autoscaling/apis/get-autoscaling-policy.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<titleabbrev>Get autoscaling policy</titleabbrev>
77
++++
88

9+
experimental[]
10+
911
Get autoscaling policy.
1012

1113
[[autoscaling-get-autoscaling-policy-request]]

docs/reference/autoscaling/apis/put-autoscaling-policy.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<titleabbrev>Put autoscaling policy</titleabbrev>
77
++++
88

9+
experimental[]
10+
911
Put autoscaling policy.
1012

1113
[[autoscaling-put-autoscaling-policy-request]]

docs/reference/index.asciidoc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,8 @@ include::data-management.asciidoc[]
4848

4949
include::ilm/index.asciidoc[]
5050

51-
ifdef::permanently-unreleased-branch[]
52-
5351
include::autoscaling/index.asciidoc[]
5452

55-
endif::[]
56-
5753
include::monitoring/index.asciidoc[]
5854

5955
include::frozen-indices.asciidoc[]

docs/reference/rest-api/index.asciidoc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ We are working on including more {es} APIs in this section. Some content might
1111
not be included yet.
1212

1313
* <<api-conventions, API conventions>>
14-
ifdef::permanently-unreleased-branch[]
1514
* <<autoscaling-apis, Autoscaling APIs>>
16-
endif::[]
1715
* <<cat, cat APIs>>
1816
* <<cluster, Cluster APIs>>
1917
* <<ccr-apis,{ccr-cap} APIs>>
@@ -43,9 +41,7 @@ endif::[]
4341
--
4442

4543
include::{es-repo-dir}/api-conventions.asciidoc[]
46-
ifdef::permanently-unreleased-branch[]
4744
include::{es-repo-dir}/autoscaling/apis/autoscaling-apis.asciidoc[]
48-
endif::[]
4945
include::{es-repo-dir}/cat.asciidoc[]
5046
include::{es-repo-dir}/cluster.asciidoc[]
5147
include::{es-repo-dir}/ccr/apis/ccr-apis.asciidoc[]

x-pack/plugin/autoscaling/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ esplugin {
1212
}
1313
archivesBaseName = 'x-pack-autoscaling'
1414

15-
tasks.named('internalClusterTest').configure {
16-
if (BuildParams.isSnapshotBuild() == false) {
17-
systemProperty 'es.autoscaling_feature_flag_registered', 'true'
18-
}
19-
}
20-
2115
dependencies {
2216
compileOnly project(path: xpackModule('core'), configuration: 'default')
2317
testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts')
2418
}
2519

26-
addQaCheckDependencies()
20+
addQaCheckDependencies()

x-pack/plugin/autoscaling/qa/rest/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ restResources {
1515

1616
testClusters.all {
1717
testDistribution = 'DEFAULT'
18-
if (BuildParams.isSnapshotBuild() == false) {
19-
systemProperty 'es.autoscaling_feature_flag_registered', 'true'
20-
}
21-
setting 'xpack.autoscaling.enabled', 'true'
2218
setting 'xpack.security.enabled', 'true'
2319
extraConfigFile 'roles.yml', file('autoscaling-roles.yml')
2420
user username: 'autoscaling-admin', password: 'autoscaling-admin-password', role: 'superuser'

x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/AutoscalingIntegTestCase.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
2424
@Override
2525
protected Settings nodeSettings(final int nodeOrdinal) {
2626
final Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal));
27-
builder.put(Autoscaling.AUTOSCALING_ENABLED_SETTING.getKey(), true);
2827
builder.put(XPackSettings.SECURITY_ENABLED.getKey(), false);
2928
return builder.build();
3029
}
@@ -37,7 +36,6 @@ protected Collection<Class<? extends Plugin>> transportClientPlugins() {
3736
@Override
3837
protected Settings transportClientSettings() {
3938
final Settings.Builder builder = Settings.builder().put(super.transportClientSettings());
40-
builder.put(Autoscaling.AUTOSCALING_ENABLED_SETTING.getKey(), true);
4139
builder.put(XPackSettings.SECURITY_ENABLED.getKey(), false);
4240
return builder.build();
4341
}

x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageIT.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.elasticsearch.common.settings.Settings;
2222
import org.elasticsearch.plugins.Plugin;
2323
import org.elasticsearch.test.ESIntegTestCase;
24-
import org.elasticsearch.xpack.autoscaling.Autoscaling;
2524
import org.elasticsearch.xpack.autoscaling.LocalStateAutoscaling;
2625
import org.elasticsearch.xpack.autoscaling.action.GetAutoscalingCapacityAction;
2726
import org.elasticsearch.xpack.autoscaling.action.PutAutoscalingPolicyAction;
@@ -55,8 +54,7 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
5554
@Override
5655
protected Settings nodeSettings(final int nodeOrdinal) {
5756
final Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal));
58-
builder.put(Autoscaling.AUTOSCALING_ENABLED_SETTING.getKey(), true)
59-
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey(), (WATERMARK_BYTES * 2) + "b")
57+
builder.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey(), (WATERMARK_BYTES * 2) + "b")
6058
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey(), WATERMARK_BYTES + "b")
6159
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_WATERMARK_SETTING.getKey(), "0b")
6260
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_REROUTE_INTERVAL_SETTING.getKey(), "0ms")
@@ -72,7 +70,6 @@ protected Collection<Class<? extends Plugin>> transportClientPlugins() {
7270
@Override
7371
protected Settings transportClientSettings() {
7472
final Settings.Builder builder = Settings.builder().put(super.transportClientSettings());
75-
builder.put(Autoscaling.AUTOSCALING_ENABLED_SETTING.getKey(), true);
7673
builder.put(XPackSettings.SECURITY_ENABLED.getKey(), false);
7774
return builder.build();
7875
}

x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java

Lines changed: 15 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
package org.elasticsearch.xpack.autoscaling;
88

99
import org.apache.lucene.util.SetOnce;
10-
import org.elasticsearch.Build;
1110
import org.elasticsearch.action.ActionRequest;
1211
import org.elasticsearch.action.ActionResponse;
1312
import org.elasticsearch.client.Client;
@@ -21,7 +20,6 @@
2120
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
2221
import org.elasticsearch.common.settings.ClusterSettings;
2322
import org.elasticsearch.common.settings.IndexScopedSettings;
24-
import org.elasticsearch.common.settings.Setting;
2523
import org.elasticsearch.common.settings.Settings;
2624
import org.elasticsearch.common.settings.SettingsFilter;
2725
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
@@ -68,61 +66,21 @@
6866
*/
6967
public class Autoscaling extends Plugin implements ActionPlugin, ExtensiblePlugin, AutoscalingExtension {
7068

71-
private static final Boolean AUTOSCALING_FEATURE_FLAG_REGISTERED;
72-
7369
static {
7470
final String property = System.getProperty("es.autoscaling_feature_flag_registered");
75-
if (Build.CURRENT.isSnapshot() && property != null) {
76-
throw new IllegalArgumentException("es.autoscaling_feature_flag_registered is only supported in non-snapshot builds");
77-
}
78-
if ("true".equals(property)) {
79-
AUTOSCALING_FEATURE_FLAG_REGISTERED = true;
80-
} else if ("false".equals(property)) {
81-
AUTOSCALING_FEATURE_FLAG_REGISTERED = false;
82-
} else if (property == null) {
83-
AUTOSCALING_FEATURE_FLAG_REGISTERED = null;
84-
} else {
85-
throw new IllegalArgumentException(
86-
"expected es.autoscaling_feature_flag_registered to be unset or [true|false] but was [" + property + "]"
87-
);
71+
if (property != null) {
72+
throw new IllegalArgumentException("es.autoscaling_feature_flag_registered is no longer supported");
8873
}
8974
}
9075

91-
public static final Setting<Boolean> AUTOSCALING_ENABLED_SETTING = Setting.boolSetting(
92-
"xpack.autoscaling.enabled",
93-
true,
94-
Setting.Property.NodeScope
95-
);
96-
97-
private final boolean enabled;
98-
9976
private final List<AutoscalingExtension> autoscalingExtensions;
10077
private final SetOnce<ClusterService> clusterService = new SetOnce<>();
10178
private final SetOnce<AllocationDeciders> allocationDeciders = new SetOnce<>();
10279

103-
public Autoscaling(final Settings settings) {
104-
this.enabled = AUTOSCALING_ENABLED_SETTING.get(settings);
80+
public Autoscaling() {
10581
this.autoscalingExtensions = new ArrayList<>(org.elasticsearch.common.collect.List.of(this));
10682
}
10783

108-
/**
109-
* The settings defined by autoscaling.
110-
*
111-
* @return the settings
112-
*/
113-
@Override
114-
public List<Setting<?>> getSettings() {
115-
if (isSnapshot() || (AUTOSCALING_FEATURE_FLAG_REGISTERED != null && AUTOSCALING_FEATURE_FLAG_REGISTERED)) {
116-
return org.elasticsearch.common.collect.List.of(AUTOSCALING_ENABLED_SETTING);
117-
} else {
118-
return org.elasticsearch.common.collect.List.of();
119-
}
120-
}
121-
122-
boolean isSnapshot() {
123-
return Build.CURRENT.isSnapshot();
124-
}
125-
12684
@Override
12785
public Collection<Object> createComponents(
12886
Client client,
@@ -143,16 +101,12 @@ public Collection<Object> createComponents(
143101

144102
@Override
145103
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
146-
if (enabled) {
147-
return org.elasticsearch.common.collect.List.of(
148-
new ActionHandler<>(GetAutoscalingCapacityAction.INSTANCE, TransportGetAutoscalingCapacityAction.class),
149-
new ActionHandler<>(DeleteAutoscalingPolicyAction.INSTANCE, TransportDeleteAutoscalingPolicyAction.class),
150-
new ActionHandler<>(GetAutoscalingPolicyAction.INSTANCE, TransportGetAutoscalingPolicyAction.class),
151-
new ActionHandler<>(PutAutoscalingPolicyAction.INSTANCE, TransportPutAutoscalingPolicyAction.class)
152-
);
153-
} else {
154-
return org.elasticsearch.common.collect.List.of();
155-
}
104+
return org.elasticsearch.common.collect.List.of(
105+
new ActionHandler<>(GetAutoscalingCapacityAction.INSTANCE, TransportGetAutoscalingCapacityAction.class),
106+
new ActionHandler<>(DeleteAutoscalingPolicyAction.INSTANCE, TransportDeleteAutoscalingPolicyAction.class),
107+
new ActionHandler<>(GetAutoscalingPolicyAction.INSTANCE, TransportGetAutoscalingPolicyAction.class),
108+
new ActionHandler<>(PutAutoscalingPolicyAction.INSTANCE, TransportPutAutoscalingPolicyAction.class)
109+
);
156110
}
157111

158112
@Override
@@ -165,16 +119,12 @@ public List<RestHandler> getRestHandlers(
165119
final IndexNameExpressionResolver indexNameExpressionResolver,
166120
final Supplier<DiscoveryNodes> nodesInCluster
167121
) {
168-
if (enabled) {
169-
return org.elasticsearch.common.collect.List.of(
170-
new RestGetAutoscalingCapacityHandler(),
171-
new RestDeleteAutoscalingPolicyHandler(),
172-
new RestGetAutoscalingPolicyHandler(),
173-
new RestPutAutoscalingPolicyHandler()
174-
);
175-
} else {
176-
return org.elasticsearch.common.collect.List.of();
177-
}
122+
return org.elasticsearch.common.collect.List.of(
123+
new RestGetAutoscalingCapacityHandler(),
124+
new RestDeleteAutoscalingPolicyHandler(),
125+
new RestGetAutoscalingPolicyHandler(),
126+
new RestPutAutoscalingPolicyHandler()
127+
);
178128
}
179129

180130
@Override

x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ public static SortedSet<String> randomRoles() {
191191
}
192192

193193
public static NamedWriteableRegistry getAutoscalingNamedWriteableRegistry() {
194-
return new NamedWriteableRegistry(new Autoscaling(Settings.EMPTY).getNamedWriteables());
194+
return new NamedWriteableRegistry(new Autoscaling().getNamedWriteables());
195195
}
196196

197197
public static NamedXContentRegistry getAutoscalingXContentRegistry() {
198-
return new NamedXContentRegistry(new Autoscaling(Settings.EMPTY).getNamedXContent());
198+
return new NamedXContentRegistry(new Autoscaling().getNamedXContent());
199199
}
200200
}

x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingTests.java

Lines changed: 0 additions & 41 deletions
This file was deleted.

x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/LocalStateAutoscaling.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class LocalStateAutoscaling extends LocalStateCompositeXPackPlugin {
1414

1515
public LocalStateAutoscaling(final Settings settings) {
1616
super(settings, null);
17-
plugins.add(new Autoscaling(settings) {
17+
plugins.add(new Autoscaling() {
1818

1919
@Override
2020
protected XPackLicenseState getLicenseState() {

x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ testClusters.all {
3838
numberOfNodes = 3
3939
testDistribution = 'DEFAULT'
4040

41-
if (BuildParams.isSnapshotBuild() == false) {
42-
systemProperty 'es.autoscaling_feature_flag_registered', 'true'
43-
}
4441
setting 'xpack.security.enabled', 'true'
4542
setting 'xpack.monitoring.elasticsearch.collection.enabled', 'false'
4643
setting 'xpack.ml.enabled', 'true'

0 commit comments

Comments
 (0)