Skip to content

Commit d18ce7d

Browse files
authored
[8.18] Mark all features added before 8.18 as assumed (#119056)
8.x edition of #119055 to mark features to be removed in 9.0 as assumed
1 parent de7bb61 commit d18ce7d

File tree

53 files changed

+130
-97
lines changed

Some content is hidden

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

53 files changed

+130
-97
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class DataStreamLifecycleHealthInfoPublisher {
4545
Setting.Property.Dynamic,
4646
Setting.Property.NodeScope
4747
);
48-
public static final NodeFeature DSL_HEALTH_INFO_FEATURE = new NodeFeature("health.dsl.info");
48+
public static final NodeFeature DSL_HEALTH_INFO_FEATURE = new NodeFeature("health.dsl.info", true);
4949

5050
private final Client client;
5151
private final ClusterService clusterService;

plugins/mapper-annotated-text/src/main/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
**/
6565
public class AnnotatedTextFieldMapper extends FieldMapper {
6666

67-
public static final NodeFeature SYNTHETIC_SOURCE_SUPPORT = new NodeFeature("mapper.annotated_text.synthetic_source");
67+
public static final NodeFeature SYNTHETIC_SOURCE_SUPPORT = new NodeFeature("mapper.annotated_text.synthetic_source", true);
6868

6969
public static final String CONTENT_TYPE = "annotated_text";
7070

server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/AllocationStatsFeatures.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import java.util.Set;
1616

1717
public class AllocationStatsFeatures implements FeatureSpecification {
18-
public static final NodeFeature INCLUDE_DISK_THRESHOLD_SETTINGS = new NodeFeature("stats.include_disk_thresholds");
18+
public static final NodeFeature INCLUDE_DISK_THRESHOLD_SETTINGS = new NodeFeature("stats.include_disk_thresholds", true);
1919

2020
@Override
2121
public Set<NodeFeature> getFeatures() {

server/src/main/java/org/elasticsearch/action/admin/indices/rollover/LazyRolloverAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public final class LazyRolloverAction extends ActionType<RolloverResponse> {
5353

5454
private static final Logger logger = LogManager.getLogger(LazyRolloverAction.class);
5555

56-
public static final NodeFeature DATA_STREAM_LAZY_ROLLOVER = new NodeFeature("data_stream.rollover.lazy");
56+
public static final NodeFeature DATA_STREAM_LAZY_ROLLOVER = new NodeFeature("data_stream.rollover.lazy", true);
5757

5858
public static final LazyRolloverAction INSTANCE = new LazyRolloverAction();
5959
public static final String NAME = "indices:admin/data_stream/lazy_rollover";

server/src/main/java/org/elasticsearch/action/bulk/TransportSimulateBulkAction.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,17 @@
8383
* shards are not actually modified).
8484
*/
8585
public class TransportSimulateBulkAction extends TransportAbstractBulkAction {
86-
public static final NodeFeature SIMULATE_MAPPING_VALIDATION = new NodeFeature("simulate.mapping.validation");
87-
public static final NodeFeature SIMULATE_MAPPING_VALIDATION_TEMPLATES = new NodeFeature("simulate.mapping.validation.templates");
86+
public static final NodeFeature SIMULATE_MAPPING_VALIDATION = new NodeFeature("simulate.mapping.validation", true);
87+
public static final NodeFeature SIMULATE_MAPPING_VALIDATION_TEMPLATES = new NodeFeature("simulate.mapping.validation.templates", true);
8888
public static final NodeFeature SIMULATE_COMPONENT_TEMPLATE_SUBSTITUTIONS = new NodeFeature(
89-
"simulate.component.template.substitutions"
89+
"simulate.component.template.substitutions",
90+
true
9091
);
91-
public static final NodeFeature SIMULATE_INDEX_TEMPLATE_SUBSTITUTIONS = new NodeFeature("simulate.index.template.substitutions");
92-
public static final NodeFeature SIMULATE_MAPPING_ADDITION = new NodeFeature("simulate.mapping.addition");
93-
public static final NodeFeature SIMULATE_SUPPORT_NON_TEMPLATE_MAPPING = new NodeFeature("simulate.support.non.template.mapping");
92+
public static final NodeFeature SIMULATE_INDEX_TEMPLATE_SUBSTITUTIONS = new NodeFeature("simulate.index.template.substitutions", true);
93+
public static final NodeFeature SIMULATE_MAPPING_ADDITION = new NodeFeature("simulate.mapping.addition", true);
94+
public static final NodeFeature SIMULATE_SUPPORT_NON_TEMPLATE_MAPPING = new NodeFeature("simulate.support.non.template.mapping", true);
9495
public static final NodeFeature SIMULATE_IGNORED_FIELDS = new NodeFeature("simulate.ignored.fields");
96+
9597
private final IndicesService indicesService;
9698
private final NamedXContentRegistry xContentRegistry;
9799
private final Set<IndexSettingProvider> indexSettingProviders;

server/src/main/java/org/elasticsearch/action/datastreams/autosharding/DataStreamAutoShardingService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class DataStreamAutoShardingService {
4343
private static final Logger logger = LogManager.getLogger(DataStreamAutoShardingService.class);
4444
public static final String DATA_STREAMS_AUTO_SHARDING_ENABLED = "data_streams.auto_sharding.enabled";
4545

46-
public static final NodeFeature DATA_STREAM_AUTO_SHARDING_FEATURE = new NodeFeature("data_stream.auto_sharding");
46+
public static final NodeFeature DATA_STREAM_AUTO_SHARDING_FEATURE = new NodeFeature("data_stream.auto_sharding", true);
4747

4848
public static final Setting<List<String>> DATA_STREAMS_AUTO_SHARDING_EXCLUDES_SETTING = Setting.listSetting(
4949
"data_streams.auto_sharding.excludes",

server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamGlobalRetention.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
public record DataStreamGlobalRetention(@Nullable TimeValue defaultRetention, @Nullable TimeValue maxRetention) implements Writeable {
2525

26-
public static final NodeFeature GLOBAL_RETENTION = new NodeFeature("data_stream.lifecycle.global_retention");
26+
public static final NodeFeature GLOBAL_RETENTION = new NodeFeature("data_stream.lifecycle.global_retention", true);
2727
public static final TimeValue MIN_RETENTION_VALUE = TimeValue.timeValueSeconds(10);
2828

2929
/**

server/src/main/java/org/elasticsearch/cluster/metadata/DesiredNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public final class DesiredNode implements Writeable, ToXContentObject, Comparabl
4949

5050
public static final NodeFeature RANGE_FLOAT_PROCESSORS_SUPPORTED = new NodeFeature("desired_node.range_float_processors");
5151
public static final NodeFeature DOUBLE_PROCESSORS_SUPPORTED = new NodeFeature("desired_node.double_processors");
52-
public static final NodeFeature DESIRED_NODE_VERSION_DEPRECATED = new NodeFeature("desired_node.version_deprecated");
52+
public static final NodeFeature DESIRED_NODE_VERSION_DEPRECATED = new NodeFeature("desired_node.version_deprecated", true);
5353

5454
public static final TransportVersion RANGE_FLOAT_PROCESSORS_SUPPORT_TRANSPORT_VERSION = TransportVersions.V_8_3_0;
5555

server/src/main/java/org/elasticsearch/cluster/routing/IndexRouting.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
*/
5454
public abstract class IndexRouting {
5555

56-
static final NodeFeature BOOLEAN_ROUTING_PATH = new NodeFeature("routing.boolean_routing_path");
57-
static final NodeFeature MULTI_VALUE_ROUTING_PATH = new NodeFeature("routing.multi_value_routing_path");
56+
static final NodeFeature BOOLEAN_ROUTING_PATH = new NodeFeature("routing.boolean_routing_path", true);
57+
static final NodeFeature MULTI_VALUE_ROUTING_PATH = new NodeFeature("routing.multi_value_routing_path", true);
5858
static final NodeFeature LOGSB_ROUTE_ON_SORT_FIELDS = new NodeFeature("routing.logsb_route_on_sort_fields");
5959

6060
/**

server/src/main/java/org/elasticsearch/features/FeatureSpecification.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@
2323
* unless they also support that feature (this is known as the 'feature ratchet').
2424
* So once a feature is supported by a cluster, it will always be supported by that cluster in the future.
2525
* <p>
26+
* The only situation where features can be removed is on a compatibility boundary (normally a new major version).
27+
* Because a new major version can only form a cluster with the highest minor of the previous major,
28+
* any features introduced before that point can be assumed to always be present on that cluster.
29+
* The feature itself can be removed by marking it as assumed by {@link NodeFeature#assumedAfterNextCompatibilityBoundary()},
30+
* in the last minor, and then removing it and associated conditions in the new major version.
31+
* <p>
2632
* The feature information in cluster state should not normally be directly accessed.
27-
* All feature checks should be done through {@code FeatureService} to ensure that Elasticsearch's
33+
* All feature checks should be done through {@link FeatureService} to ensure that Elasticsearch's
2834
* guarantees on the introduction of new functionality are followed;
2935
* that is, new functionality is not enabled until all nodes in the cluster support it.
3036
* <p>

0 commit comments

Comments
 (0)