Skip to content

Commit a2d84b1

Browse files
authored
Remove assumed features in server for 9.0 (#119946)
All features added before 8.18 can now be assumed and removed in 9.0
1 parent 213f86a commit a2d84b1

File tree

142 files changed

+90
-1599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+90
-1599
lines changed

modules/data-streams/src/main/java/org/elasticsearch/datastreams/DataStreamFeatures.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99

1010
package org.elasticsearch.datastreams;
1111

12-
import org.elasticsearch.action.admin.indices.rollover.LazyRolloverAction;
13-
import org.elasticsearch.action.datastreams.autosharding.DataStreamAutoShardingService;
14-
import org.elasticsearch.cluster.metadata.DataStreamGlobalRetention;
15-
import org.elasticsearch.datastreams.lifecycle.health.DataStreamLifecycleHealthInfoPublisher;
1612
import org.elasticsearch.features.FeatureSpecification;
1713
import org.elasticsearch.features.NodeFeature;
1814

@@ -27,12 +23,7 @@ public class DataStreamFeatures implements FeatureSpecification {
2723

2824
@Override
2925
public Set<NodeFeature> getFeatures() {
30-
return Set.of(
31-
DataStreamLifecycleHealthInfoPublisher.DSL_HEALTH_INFO_FEATURE, // Added in 8.12
32-
LazyRolloverAction.DATA_STREAM_LAZY_ROLLOVER, // Added in 8.13
33-
DataStreamAutoShardingService.DATA_STREAM_AUTO_SHARDING_FEATURE,
34-
DataStreamGlobalRetention.GLOBAL_RETENTION // Added in 8.14
35-
);
26+
return Set.of();
3627
}
3728

3829
@Override

modules/data-streams/src/main/java/org/elasticsearch/datastreams/DataStreamsPlugin.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ public Collection<?> createComponents(PluginServices services) {
197197
settings,
198198
services.client(),
199199
services.clusterService(),
200-
errorStoreInitialisationService.get(),
201-
services.featureService()
200+
errorStoreInitialisationService.get()
202201
)
203202
);
204203
dataLifecycleInitialisationService.set(

modules/data-streams/src/main/java/org/elasticsearch/datastreams/lifecycle/health/DataStreamLifecycleHealthInfoPublisher.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
import org.elasticsearch.common.settings.Setting;
2020
import org.elasticsearch.common.settings.Settings;
2121
import org.elasticsearch.datastreams.lifecycle.DataStreamLifecycleErrorStore;
22-
import org.elasticsearch.features.FeatureService;
23-
import org.elasticsearch.features.NodeFeature;
2422
import org.elasticsearch.health.node.DataStreamLifecycleHealthInfo;
2523
import org.elasticsearch.health.node.DslErrorInfo;
2624
import org.elasticsearch.health.node.UpdateHealthInfoCacheAction;
@@ -45,26 +43,22 @@ public class DataStreamLifecycleHealthInfoPublisher {
4543
Setting.Property.Dynamic,
4644
Setting.Property.NodeScope
4745
);
48-
public static final NodeFeature DSL_HEALTH_INFO_FEATURE = new NodeFeature("health.dsl.info", true);
4946

5047
private final Client client;
5148
private final ClusterService clusterService;
5249
private final DataStreamLifecycleErrorStore errorStore;
53-
private final FeatureService featureService;
5450
private volatile int signallingErrorRetryInterval;
5551
private volatile int maxNumberOfErrorsToPublish;
5652

5753
public DataStreamLifecycleHealthInfoPublisher(
5854
Settings settings,
5955
Client client,
6056
ClusterService clusterService,
61-
DataStreamLifecycleErrorStore errorStore,
62-
FeatureService featureService
57+
DataStreamLifecycleErrorStore errorStore
6358
) {
6459
this.client = client;
6560
this.clusterService = clusterService;
6661
this.errorStore = errorStore;
67-
this.featureService = featureService;
6862
this.signallingErrorRetryInterval = DATA_STREAM_SIGNALLING_ERROR_RETRY_INTERVAL_SETTING.get(settings);
6963
this.maxNumberOfErrorsToPublish = DATA_STREAM_LIFECYCLE_MAX_ERRORS_TO_PUBLISH_SETTING.get(settings);
7064
}
@@ -89,9 +83,6 @@ private void updateNumberOfErrorsToPublish(int newValue) {
8983
* {@link org.elasticsearch.datastreams.lifecycle.DataStreamLifecycleService#DATA_STREAM_SIGNALLING_ERROR_RETRY_INTERVAL_SETTING}
9084
*/
9185
public void publishDslErrorEntries(ActionListener<AcknowledgedResponse> actionListener) {
92-
if (featureService.clusterHasFeature(clusterService.state(), DSL_HEALTH_INFO_FEATURE) == false) {
93-
return;
94-
}
9586
// fetching the entries that persist in the error store for more than the signalling retry interval
9687
// note that we're reporting this view into the error store on every publishing iteration
9788
List<DslErrorInfo> errorEntriesToSignal = errorStore.getErrorsInfo(

modules/data-streams/src/test/java/org/elasticsearch/datastreams/lifecycle/DataStreamLifecycleServiceTests.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@
6767
import org.elasticsearch.common.unit.ByteSizeValue;
6868
import org.elasticsearch.core.TimeValue;
6969
import org.elasticsearch.core.Tuple;
70-
import org.elasticsearch.datastreams.DataStreamFeatures;
7170
import org.elasticsearch.datastreams.lifecycle.health.DataStreamLifecycleHealthInfoPublisher;
72-
import org.elasticsearch.features.FeatureService;
7371
import org.elasticsearch.index.Index;
7472
import org.elasticsearch.index.IndexMode;
7573
import org.elasticsearch.index.IndexSettings;
@@ -183,13 +181,7 @@ public void setupServices() {
183181
() -> now,
184182
errorStore,
185183
allocationService,
186-
new DataStreamLifecycleHealthInfoPublisher(
187-
Settings.EMPTY,
188-
client,
189-
clusterService,
190-
errorStore,
191-
new FeatureService(List.of(new DataStreamFeatures()))
192-
),
184+
new DataStreamLifecycleHealthInfoPublisher(Settings.EMPTY, client, clusterService, errorStore),
193185
globalRetentionSettings
194186
);
195187
clientDelegate = null;
@@ -1465,13 +1457,7 @@ public void testTrackingTimeStats() {
14651457
() -> now.getAndAdd(delta),
14661458
errorStore,
14671459
mock(AllocationService.class),
1468-
new DataStreamLifecycleHealthInfoPublisher(
1469-
Settings.EMPTY,
1470-
getTransportRequestsRecordingClient(),
1471-
clusterService,
1472-
errorStore,
1473-
new FeatureService(List.of(new DataStreamFeatures()))
1474-
),
1460+
new DataStreamLifecycleHealthInfoPublisher(Settings.EMPTY, getTransportRequestsRecordingClient(), clusterService, errorStore),
14751461
globalRetentionSettings
14761462
);
14771463
assertThat(service.getLastRunDuration(), is(nullValue()));

modules/data-streams/src/test/java/org/elasticsearch/datastreams/lifecycle/health/DataStreamLifecycleHealthInfoPublisherTests.java

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@
2424
import org.elasticsearch.common.settings.ClusterSettings;
2525
import org.elasticsearch.common.settings.Setting;
2626
import org.elasticsearch.common.settings.Settings;
27-
import org.elasticsearch.datastreams.DataStreamFeatures;
2827
import org.elasticsearch.datastreams.lifecycle.DataStreamLifecycleErrorStore;
2928
import org.elasticsearch.datastreams.lifecycle.DataStreamLifecycleService;
30-
import org.elasticsearch.features.FeatureService;
3129
import org.elasticsearch.health.node.DataStreamLifecycleHealthInfo;
3230
import org.elasticsearch.health.node.DslErrorInfo;
3331
import org.elasticsearch.health.node.UpdateHealthInfoCacheAction;
@@ -40,7 +38,6 @@
4038

4139
import java.util.HashSet;
4240
import java.util.List;
43-
import java.util.Map;
4441
import java.util.Set;
4542
import java.util.concurrent.CopyOnWriteArrayList;
4643

@@ -83,13 +80,7 @@ public void setupServices() {
8380

8481
final Client client = getTransportRequestsRecordingClient();
8582
errorStore = new DataStreamLifecycleErrorStore(() -> now);
86-
dslHealthInfoPublisher = new DataStreamLifecycleHealthInfoPublisher(
87-
Settings.EMPTY,
88-
client,
89-
clusterService,
90-
errorStore,
91-
new FeatureService(List.of(new DataStreamFeatures()))
92-
);
83+
dslHealthInfoPublisher = new DataStreamLifecycleHealthInfoPublisher(Settings.EMPTY, client, clusterService, errorStore);
9384
}
9485

9586
@After
@@ -105,16 +96,6 @@ public void testPublishDslErrorEntries() {
10596
}
10697
errorStore.recordError("testIndex", new IllegalStateException("bad state"));
10798
ClusterState stateWithHealthNode = ClusterStateCreationUtils.state(node1, node1, node1, allNodes);
108-
stateWithHealthNode = ClusterState.builder(stateWithHealthNode)
109-
.nodeFeatures(
110-
Map.of(
111-
node1.getId(),
112-
Set.of(DataStreamLifecycleHealthInfoPublisher.DSL_HEALTH_INFO_FEATURE.id()),
113-
node2.getId(),
114-
Set.of(DataStreamLifecycleHealthInfoPublisher.DSL_HEALTH_INFO_FEATURE.id())
115-
)
116-
)
117-
.build();
11899
ClusterServiceUtils.setState(clusterService, stateWithHealthNode);
119100
dslHealthInfoPublisher.publishDslErrorEntries(new ActionListener<>() {
120101
@Override
@@ -143,16 +124,6 @@ public void testPublishDslErrorEntriesNoHealthNode() {
143124
errorStore.recordError("testIndex", new IllegalStateException("bad state"));
144125

145126
ClusterState stateNoHealthNode = ClusterStateCreationUtils.state(node1, node1, null, allNodes);
146-
stateNoHealthNode = ClusterState.builder(stateNoHealthNode)
147-
.nodeFeatures(
148-
Map.of(
149-
node1.getId(),
150-
Set.of(DataStreamLifecycleHealthInfoPublisher.DSL_HEALTH_INFO_FEATURE.id()),
151-
node2.getId(),
152-
Set.of(DataStreamLifecycleHealthInfoPublisher.DSL_HEALTH_INFO_FEATURE.id())
153-
)
154-
)
155-
.build();
156127
ClusterServiceUtils.setState(clusterService, stateNoHealthNode);
157128
dslHealthInfoPublisher.publishDslErrorEntries(new ActionListener<>() {
158129
@Override
@@ -170,16 +141,6 @@ public void onFailure(Exception e) {
170141
public void testPublishDslErrorEntriesEmptyErrorStore() {
171142
// publishes the empty error store (this is the "back to healthy" state where all errors have been fixed)
172143
ClusterState state = ClusterStateCreationUtils.state(node1, node1, node1, allNodes);
173-
state = ClusterState.builder(state)
174-
.nodeFeatures(
175-
Map.of(
176-
node1.getId(),
177-
Set.of(DataStreamLifecycleHealthInfoPublisher.DSL_HEALTH_INFO_FEATURE.id()),
178-
node2.getId(),
179-
Set.of(DataStreamLifecycleHealthInfoPublisher.DSL_HEALTH_INFO_FEATURE.id())
180-
)
181-
)
182-
.build();
183144
ClusterServiceUtils.setState(clusterService, state);
184145
dslHealthInfoPublisher.publishDslErrorEntries(new ActionListener<>() {
185146
@Override

modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,6 @@ index without timestamp with pipeline:
300300

301301
---
302302
dynamic templates:
303-
- requires:
304-
cluster_features: ["mapper.pass_through_priority"]
305-
reason: support for priority in passthrough objects
306303
- do:
307304
allowed_warnings:
308305
- "index template [my-dynamic-template] has index patterns [k9s*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-dynamic-template] will take precedence during new index creation"
@@ -450,9 +447,6 @@ dynamic templates:
450447

451448
---
452449
dynamic templates - conflicting aliases:
453-
- requires:
454-
cluster_features: ["mapper.pass_through_priority"]
455-
reason: support for priority in passthrough objects
456450
- do:
457451
allowed_warnings:
458452
- "index template [my-dynamic-template] has index patterns [k9s*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-dynamic-template] will take precedence during new index creation"
@@ -549,9 +543,6 @@ dynamic templates - conflicting aliases:
549543

550544
---
551545
dynamic templates - conflicting aliases with top-level field:
552-
- requires:
553-
cluster_features: ["mapper.pass_through_priority"]
554-
reason: support for priority in passthrough objects
555546
- do:
556547
allowed_warnings:
557548
- "index template [my-dynamic-template] has index patterns [otel] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-dynamic-template] will take precedence during new index creation"
@@ -632,9 +623,6 @@ dynamic templates - conflicting aliases with top-level field:
632623

633624
---
634625
dynamic templates with nesting:
635-
- requires:
636-
cluster_features: ["mapper.pass_through_priority"]
637-
reason: support for priority in passthrough objects
638626
- do:
639627
allowed_warnings:
640628
- "index template [my-dynamic-template] has index patterns [k9s*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-dynamic-template] will take precedence during new index creation"
@@ -810,10 +798,6 @@ dynamic templates with nesting:
810798

811799
---
812800
dynamic templates with incremental indexing:
813-
- requires:
814-
cluster_features: ["mapper.pass_through_priority"]
815-
reason: support for priority in passthrough objects
816-
817801
- do:
818802
allowed_warnings:
819803
- "index template [my-dynamic-template] has index patterns [k9s*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-dynamic-template] will take precedence during new index creation"
@@ -1038,9 +1022,6 @@ dynamic templates with incremental indexing:
10381022

10391023
---
10401024
subobject in passthrough object auto flatten:
1041-
- requires:
1042-
cluster_features: ["mapper.pass_through_priority"]
1043-
reason: support for priority in passthrough objects
10441025
- do:
10451026
allowed_warnings:
10461027
- "index template [my-passthrough-template] has index patterns [k9s*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-passthrough-template] will take precedence during new index creation"
@@ -1108,9 +1089,6 @@ enable subobjects in passthrough object:
11081089

11091090
---
11101091
passthrough objects with duplicate priority:
1111-
- requires:
1112-
cluster_features: ["mapper.pass_through_priority"]
1113-
reason: support for priority in passthrough objects
11141092
- do:
11151093
catch: /has a conflicting param/
11161094
indices.put_index_template:
@@ -1135,9 +1113,6 @@ passthrough objects with duplicate priority:
11351113

11361114
---
11371115
dimensions with ignore_malformed and ignore_above:
1138-
- requires:
1139-
cluster_features: ["mapper.keyword_dimension_ignore_above"]
1140-
reason: support for ignore_above on keyword dimensions
11411116
- do:
11421117
allowed_warnings:
11431118
- "index template [my-dynamic-template] has index patterns [k9s*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-dynamic-template] will take precedence during new index creation"
@@ -1229,9 +1204,6 @@ dimensions with ignore_malformed and ignore_above:
12291204

12301205
---
12311206
non string dimension fields:
1232-
- requires:
1233-
cluster_features: ["mapper.pass_through_priority", "routing.boolean_routing_path", "mapper.boolean_dimension"]
1234-
reason: support for priority in passthrough objects
12351207
- do:
12361208
allowed_warnings:
12371209
- "index template [my-dynamic-template] has index patterns [k9s*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-dynamic-template] will take precedence during new index creation"
@@ -1339,10 +1311,6 @@ non string dimension fields:
13391311

13401312
---
13411313
multi value dimensions:
1342-
- requires:
1343-
cluster_features: ["routing.multi_value_routing_path"]
1344-
reason: support for multi-value dimensions
1345-
13461314
- do:
13471315
allowed_warnings:
13481316
- "index template [my-dynamic-template] has index patterns [k9s*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-dynamic-template] will take precedence during new index creation"

modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/direct/DatabaseConfiguration.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,6 @@ public void writeTo(StreamOutput out) throws IOException {
160160
if (provider instanceof Maxmind maxmind) {
161161
out.writeString(maxmind.accountId);
162162
} else {
163-
/*
164-
* The existence of a non-Maxmind providers is gated on the feature get_database_configuration_action.multi_node, and
165-
* get_database_configuration_action.multi_node is only available on or after
166-
* TransportVersions.INGEST_GEO_DATABASE_PROVIDERS.
167-
*/
168163
assert false : "non-maxmind DatabaseConfiguration.Provider [" + provider.getWriteableName() + "]";
169164
}
170165
}

modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/direct/TransportGetDatabaseConfigurationAction.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import org.elasticsearch.cluster.service.ClusterService;
1818
import org.elasticsearch.common.io.stream.StreamInput;
1919
import org.elasticsearch.common.regex.Regex;
20-
import org.elasticsearch.features.FeatureService;
2120
import org.elasticsearch.ingest.geoip.DatabaseNodeService;
2221
import org.elasticsearch.ingest.geoip.GeoIpTaskState;
2322
import org.elasticsearch.ingest.geoip.IngestGeoIpMetadata;
@@ -41,16 +40,13 @@
4140
import java.util.Set;
4241
import java.util.stream.Collectors;
4342

44-
import static org.elasticsearch.ingest.IngestGeoIpFeatures.GET_DATABASE_CONFIGURATION_ACTION_MULTI_NODE;
45-
4643
public class TransportGetDatabaseConfigurationAction extends TransportNodesAction<
4744
GetDatabaseConfigurationAction.Request,
4845
GetDatabaseConfigurationAction.Response,
4946
GetDatabaseConfigurationAction.NodeRequest,
5047
GetDatabaseConfigurationAction.NodeResponse,
5148
List<DatabaseConfigurationMetadata>> {
5249

53-
private final FeatureService featureService;
5450
private final DatabaseNodeService databaseNodeService;
5551

5652
@Inject
@@ -59,7 +55,6 @@ public TransportGetDatabaseConfigurationAction(
5955
ClusterService clusterService,
6056
ThreadPool threadPool,
6157
ActionFilters actionFilters,
62-
FeatureService featureService,
6358
DatabaseNodeService databaseNodeService
6459
) {
6560
super(
@@ -70,39 +65,9 @@ public TransportGetDatabaseConfigurationAction(
7065
GetDatabaseConfigurationAction.NodeRequest::new,
7166
threadPool.executor(ThreadPool.Names.MANAGEMENT)
7267
);
73-
this.featureService = featureService;
7468
this.databaseNodeService = databaseNodeService;
7569
}
7670

77-
@Override
78-
protected void doExecute(
79-
Task task,
80-
GetDatabaseConfigurationAction.Request request,
81-
ActionListener<GetDatabaseConfigurationAction.Response> listener
82-
) {
83-
if (featureService.clusterHasFeature(clusterService.state(), GET_DATABASE_CONFIGURATION_ACTION_MULTI_NODE) == false) {
84-
/*
85-
* TransportGetDatabaseConfigurationAction used to be a TransportMasterNodeAction, and not all nodes in the cluster have been
86-
* updated. So we don't want to send node requests to the other nodes because they will blow up. Instead, we just return
87-
* the information that we used to return from the master node (it doesn't make any difference that this might not be the master
88-
* node, because we're only reading the cluster state). Because older nodes only know about the Maxmind provider type, we filter
89-
* out all others here to avoid causing problems on those nodes.
90-
*/
91-
newResponseAsync(
92-
task,
93-
request,
94-
createActionContext(task, request).stream()
95-
.filter(database -> database.database().provider() instanceof DatabaseConfiguration.Maxmind)
96-
.toList(),
97-
List.of(),
98-
List.of(),
99-
listener
100-
);
101-
} else {
102-
super.doExecute(task, request, listener);
103-
}
104-
}
105-
10671
protected List<DatabaseConfigurationMetadata> createActionContext(Task task, GetDatabaseConfigurationAction.Request request) {
10772
final Set<String> ids;
10873
if (request.getDatabaseIds().length == 0) {

0 commit comments

Comments
 (0)