Skip to content

Commit

Permalink
Mark all features added before 8.18 as assumed (#119055)
Browse files Browse the repository at this point in the history
Features added before 8.18 can be removed, starting with 9.0. But first they need to be marked as assumed, so existing code knows they could be removed in later builds.
  • Loading branch information
thecoop authored Jan 9, 2025
1 parent 74d2351 commit 75d1050
Show file tree
Hide file tree
Showing 55 changed files with 132 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class DataStreamLifecycleHealthInfoPublisher {
Setting.Property.Dynamic,
Setting.Property.NodeScope
);
public static final NodeFeature DSL_HEALTH_INFO_FEATURE = new NodeFeature("health.dsl.info");
public static final NodeFeature DSL_HEALTH_INFO_FEATURE = new NodeFeature("health.dsl.info", true);

private final Client client;
private final ClusterService clusterService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
**/
public class AnnotatedTextFieldMapper extends FieldMapper {

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

public static final String CONTENT_TYPE = "annotated_text";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.Set;

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

@Override
public Set<NodeFeature> getFeatures() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public final class LazyRolloverAction extends ActionType<RolloverResponse> {

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

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

public static final LazyRolloverAction INSTANCE = new LazyRolloverAction();
public static final String NAME = "indices:admin/data_stream/lazy_rollover";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public class IndexStats implements Iterable<IndexShardStats> {

// feature was effectively reverted but we still need to keep this constant around
public static final NodeFeature REVERTED_TIER_CREATION_DATE = new NodeFeature("stats.tier_creation_date");
public static final NodeFeature REVERTED_TIER_CREATION_DATE = new NodeFeature("stats.tier_creation_date", true);

private final String index;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,17 @@
* shards are not actually modified).
*/
public class TransportSimulateBulkAction extends TransportAbstractBulkAction {
public static final NodeFeature SIMULATE_MAPPING_VALIDATION = new NodeFeature("simulate.mapping.validation");
public static final NodeFeature SIMULATE_MAPPING_VALIDATION_TEMPLATES = new NodeFeature("simulate.mapping.validation.templates");
public static final NodeFeature SIMULATE_MAPPING_VALIDATION = new NodeFeature("simulate.mapping.validation", true);
public static final NodeFeature SIMULATE_MAPPING_VALIDATION_TEMPLATES = new NodeFeature("simulate.mapping.validation.templates", true);
public static final NodeFeature SIMULATE_COMPONENT_TEMPLATE_SUBSTITUTIONS = new NodeFeature(
"simulate.component.template.substitutions"
"simulate.component.template.substitutions",
true
);
public static final NodeFeature SIMULATE_INDEX_TEMPLATE_SUBSTITUTIONS = new NodeFeature("simulate.index.template.substitutions");
public static final NodeFeature SIMULATE_MAPPING_ADDITION = new NodeFeature("simulate.mapping.addition");
public static final NodeFeature SIMULATE_SUPPORT_NON_TEMPLATE_MAPPING = new NodeFeature("simulate.support.non.template.mapping");
public static final NodeFeature SIMULATE_INDEX_TEMPLATE_SUBSTITUTIONS = new NodeFeature("simulate.index.template.substitutions", true);
public static final NodeFeature SIMULATE_MAPPING_ADDITION = new NodeFeature("simulate.mapping.addition", true);
public static final NodeFeature SIMULATE_SUPPORT_NON_TEMPLATE_MAPPING = new NodeFeature("simulate.support.non.template.mapping", true);
public static final NodeFeature SIMULATE_IGNORED_FIELDS = new NodeFeature("simulate.ignored.fields");

private final IndicesService indicesService;
private final NamedXContentRegistry xContentRegistry;
private final Set<IndexSettingProvider> indexSettingProviders;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class DataStreamAutoShardingService {
private static final Logger logger = LogManager.getLogger(DataStreamAutoShardingService.class);
public static final String DATA_STREAMS_AUTO_SHARDING_ENABLED = "data_streams.auto_sharding.enabled";

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

public static final Setting<List<String>> DATA_STREAMS_AUTO_SHARDING_EXCLUDES_SETTING = Setting.listSetting(
"data_streams.auto_sharding.excludes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
public record DataStreamGlobalRetention(@Nullable TimeValue defaultRetention, @Nullable TimeValue maxRetention) implements Writeable {

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

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
public final class DesiredNode implements Writeable, ToXContentObject, Comparable<DesiredNode> {

public static final NodeFeature RANGE_FLOAT_PROCESSORS_SUPPORTED = new NodeFeature("desired_node.range_float_processors");
public static final NodeFeature DESIRED_NODE_VERSION_DEPRECATED = new NodeFeature("desired_node.version_deprecated");
public static final NodeFeature DESIRED_NODE_VERSION_DEPRECATED = new NodeFeature("desired_node.version_deprecated", true);

public static final TransportVersion RANGE_FLOAT_PROCESSORS_SUPPORT_TRANSPORT_VERSION = TransportVersions.V_8_3_0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
*/
public abstract class IndexRouting {

static final NodeFeature BOOLEAN_ROUTING_PATH = new NodeFeature("routing.boolean_routing_path");
static final NodeFeature MULTI_VALUE_ROUTING_PATH = new NodeFeature("routing.multi_value_routing_path");
static final NodeFeature BOOLEAN_ROUTING_PATH = new NodeFeature("routing.boolean_routing_path", true);
static final NodeFeature MULTI_VALUE_ROUTING_PATH = new NodeFeature("routing.multi_value_routing_path", true);
static final NodeFeature LOGSB_ROUTE_ON_SORT_FIELDS = new NodeFeature("routing.logsb_route_on_sort_fields");

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@
* unless they also support that feature (this is known as the 'feature ratchet').
* So once a feature is supported by a cluster, it will always be supported by that cluster in the future.
* <p>
* The only situation where features can be removed is on a compatibility boundary (normally a new major version).
* Because a new major version can only form a cluster with the highest minor of the previous major,
* any features introduced before that point can be assumed to always be present on that cluster.
* The feature itself can be removed by marking it as assumed by {@link NodeFeature#assumedAfterNextCompatibilityBoundary()},
* in the last minor, and then removing it and associated conditions in the new major version.
* <p>
* The feature information in cluster state should not normally be directly accessed.
* All feature checks should be done through {@code FeatureService} to ensure that Elasticsearch's
* All feature checks should be done through {@link FeatureService} to ensure that Elasticsearch's
* guarantees on the introduction of new functionality are followed;
* that is, new functionality is not enabled until all nodes in the cluster support it.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

public class HealthFeatures implements FeatureSpecification {

public static final NodeFeature SUPPORTS_EXTENDED_REPOSITORY_INDICATOR = new NodeFeature("health.extended_repository_indicator");
public static final NodeFeature SUPPORTS_EXTENDED_REPOSITORY_INDICATOR = new NodeFeature("health.extended_repository_indicator", true);

@Override
public Set<NodeFeature> getFeatures() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ private static String getIgnoreAboveDefaultValue(final Settings settings) {
}
}

public static final NodeFeature IGNORE_ABOVE_INDEX_LEVEL_SETTING = new NodeFeature("mapper.ignore_above_index_level_setting");
public static final NodeFeature IGNORE_ABOVE_INDEX_LEVEL_SETTING = new NodeFeature("mapper.ignore_above_index_level_setting", true);

private final Index index;
private final IndexVersion version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class BooleanFieldMapper extends FieldMapper {

public static final String CONTENT_TYPE = "boolean";

static final NodeFeature BOOLEAN_DIMENSION = new NodeFeature("mapper.boolean_dimension");
static final NodeFeature BOOLEAN_DIMENSION = new NodeFeature("mapper.boolean_dimension", true);

public static class Values {
public static final BytesRef TRUE = new BytesRef("T");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.List;

public class DocumentMapper {
static final NodeFeature INDEX_SORTING_ON_NESTED = new NodeFeature("mapper.index_sorting_on_nested");
static final NodeFeature INDEX_SORTING_ON_NESTED = new NodeFeature("mapper.index_sorting_on_nested", true);

private final String type;
private final CompressedXContent mappingSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class IgnoredSourceFieldMapper extends MetadataFieldMapper {

public static final TypeParser PARSER = new FixedTypeParser(context -> new IgnoredSourceFieldMapper(context.getIndexSettings()));

static final NodeFeature TRACK_IGNORED_SOURCE = new NodeFeature("mapper.track_ignored_source");
static final NodeFeature TRACK_IGNORED_SOURCE = new NodeFeature("mapper.track_ignored_source", true);
static final NodeFeature DONT_EXPAND_DOTS_IN_IGNORED_SOURCE = new NodeFeature("mapper.ignored_source.dont_expand_dots");
static final NodeFeature IGNORED_SOURCE_AS_TOP_LEVEL_METADATA_ARRAY_FIELD = new NodeFeature(
"mapper.ignored_source_as_top_level_metadata_array_field"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

public class IndexModeFieldMapper extends MetadataFieldMapper {

static final NodeFeature QUERYING_INDEX_MODE = new NodeFeature("mapper.query_index_mode");
static final NodeFeature QUERYING_INDEX_MODE = new NodeFeature("mapper.query_index_mode", true);

public static final String NAME = "_index_mode";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ public final class KeywordFieldMapper extends FieldMapper {

public static final String CONTENT_TYPE = "keyword";

static final NodeFeature KEYWORD_DIMENSION_IGNORE_ABOVE = new NodeFeature("mapper.keyword_dimension_ignore_above");
static final NodeFeature KEYWORD_NORMALIZER_SYNTHETIC_SOURCE = new NodeFeature("mapper.keyword_normalizer_synthetic_source");
static final NodeFeature KEYWORD_DIMENSION_IGNORE_ABOVE = new NodeFeature("mapper.keyword_dimension_ignore_above", true);
static final NodeFeature KEYWORD_NORMALIZER_SYNTHETIC_SOURCE = new NodeFeature("mapper.keyword_normalizer_synthetic_source", true);

public static class Defaults {
public static final FieldType FIELD_TYPE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

public abstract class Mapper implements ToXContentFragment, Iterable<Mapper> {

public static final NodeFeature SYNTHETIC_SOURCE_KEEP_FEATURE = new NodeFeature("mapper.synthetic_source_keep");
public static final NodeFeature SYNTHETIC_SOURCE_KEEP_FEATURE = new NodeFeature("mapper.synthetic_source_keep", true);

public static final String SYNTHETIC_SOURCE_KEEP_PARAM = "synthetic_source_keep";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
public class NodeMappingStats implements Writeable, ToXContentFragment {

public static final NodeFeature SEGMENT_LEVEL_FIELDS_STATS = new NodeFeature("mapper.segment_level_fields_stats");
public static final NodeFeature SEGMENT_LEVEL_FIELDS_STATS = new NodeFeature("mapper.segment_level_fields_stats", true);

private static final class Fields {
static final String MAPPINGS = "mappings";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public class ObjectMapper extends Mapper {

public static final String CONTENT_TYPE = "object";
static final String STORE_ARRAY_SOURCE_PARAM = "store_array_source";
static final NodeFeature SUBOBJECTS_AUTO = new NodeFeature("mapper.subobjects_auto");
static final NodeFeature SUBOBJECTS_AUTO = new NodeFeature("mapper.subobjects_auto", true);
// No-op. All uses of this feature were reverted but node features can't be removed.
static final NodeFeature SUBOBJECTS_AUTO_FIXES = new NodeFeature("mapper.subobjects_auto_fixes");
static final NodeFeature SUBOBJECTS_AUTO_FIXES = new NodeFeature("mapper.subobjects_auto_fixes", true);

/**
* Enhances the previously boolean option for subobjects support with an intermediate mode `auto` that uses
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class PassThroughObjectMapper extends ObjectMapper {
public static final String CONTENT_TYPE = "passthrough";
public static final String PRIORITY_PARAM_NAME = "priority";

static final NodeFeature PASS_THROUGH_PRIORITY = new NodeFeature("mapper.pass_through_priority");
static final NodeFeature PASS_THROUGH_PRIORITY = new NodeFeature("mapper.pass_through_priority", true);

public static class Builder extends ObjectMapper.Builder {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

/** A {@link FieldMapper} for indexing numeric and date ranges, and creating queries */
public class RangeFieldMapper extends FieldMapper {
public static final NodeFeature NULL_VALUES_OFF_BY_ONE_FIX = new NodeFeature("mapper.range.null_values_off_by_one_fix");
public static final NodeFeature NULL_VALUES_OFF_BY_ONE_FIX = new NodeFeature("mapper.range.null_values_off_by_one_fix", true);
public static final NodeFeature DATE_RANGE_INDEXING_FIX = new NodeFeature("mapper.range.date_range_indexing_fix");

public static final boolean DEFAULT_INCLUDE_UPPER = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,19 @@
import java.util.Locale;

public class SourceFieldMapper extends MetadataFieldMapper {
public static final NodeFeature SYNTHETIC_SOURCE_FALLBACK = new NodeFeature("mapper.source.synthetic_source_fallback");
public static final NodeFeature SYNTHETIC_SOURCE_FALLBACK = new NodeFeature("mapper.source.synthetic_source_fallback", true);
public static final NodeFeature SYNTHETIC_SOURCE_STORED_FIELDS_ADVANCE_FIX = new NodeFeature(
"mapper.source.synthetic_source_stored_fields_advance_fix"
"mapper.source.synthetic_source_stored_fields_advance_fix",
true
);
public static final NodeFeature SYNTHETIC_SOURCE_WITH_COPY_TO_AND_DOC_VALUES_FALSE_SUPPORT = new NodeFeature(
"mapper.source.synthetic_source_with_copy_to_and_doc_values_false"
"mapper.source.synthetic_source_with_copy_to_and_doc_values_false",
true
);
public static final NodeFeature SYNTHETIC_SOURCE_COPY_TO_FIX = new NodeFeature("mapper.source.synthetic_source_copy_to_fix");
public static final NodeFeature SYNTHETIC_SOURCE_COPY_TO_FIX = new NodeFeature("mapper.source.synthetic_source_copy_to_fix", true);
public static final NodeFeature SYNTHETIC_SOURCE_COPY_TO_INSIDE_OBJECTS_FIX = new NodeFeature(
"mapper.source.synthetic_source_copy_to_inside_objects_fix"
"mapper.source.synthetic_source_copy_to_inside_objects_fix",
true
);
public static final NodeFeature REMOVE_SYNTHETIC_SOURCE_ONLY_VALIDATION = new NodeFeature(
"mapper.source.remove_synthetic_source_only_validation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ public class TimeSeriesRoutingHashFieldMapper extends MetadataFieldMapper {
public static final TimeSeriesRoutingHashFieldMapper INSTANCE = new TimeSeriesRoutingHashFieldMapper();

public static final TypeParser PARSER = new FixedTypeParser(c -> c.getIndexSettings().getMode().timeSeriesRoutingHashFieldMapper());
static final NodeFeature TS_ROUTING_HASH_FIELD_PARSES_BYTES_REF = new NodeFeature("tsdb.ts_routing_hash_doc_value_parse_byte_ref");
static final NodeFeature TS_ROUTING_HASH_FIELD_PARSES_BYTES_REF = new NodeFeature(
"tsdb.ts_routing_hash_doc_value_parse_byte_ref",
true
);

public static final DocValueFormat TS_ROUTING_HASH_DOC_VALUE_FORMAT = TimeSeriesRoutingHashFieldType.DOC_VALUE_FORMAT;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@
*/
public final class FlattenedFieldMapper extends FieldMapper {

public static final NodeFeature IGNORE_ABOVE_SUPPORT = new NodeFeature("flattened.ignore_above_support");
public static final NodeFeature IGNORE_ABOVE_WITH_ARRAYS_SUPPORT = new NodeFeature("mapper.flattened.ignore_above_with_arrays_support");
public static final NodeFeature IGNORE_ABOVE_SUPPORT = new NodeFeature("flattened.ignore_above_support", true);
public static final NodeFeature IGNORE_ABOVE_WITH_ARRAYS_SUPPORT = new NodeFeature(
"mapper.flattened.ignore_above_with_arrays_support",
true
);

public static final String CONTENT_TYPE = "flattened";
public static final String KEYED_FIELD_SUFFIX = "._keyed";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ public static boolean isNotUnitVector(float magnitude) {
return Math.abs(magnitude - 1.0f) > EPS;
}

public static final NodeFeature INT4_QUANTIZATION = new NodeFeature("mapper.vectors.int4_quantization");
public static final NodeFeature BIT_VECTORS = new NodeFeature("mapper.vectors.bit_vectors");
public static final NodeFeature BBQ_FORMAT = new NodeFeature("mapper.vectors.bbq");
public static final NodeFeature INT4_QUANTIZATION = new NodeFeature("mapper.vectors.int4_quantization", true);
public static final NodeFeature BIT_VECTORS = new NodeFeature("mapper.vectors.bit_vectors", true);
public static final NodeFeature BBQ_FORMAT = new NodeFeature("mapper.vectors.bbq", true);

public static final IndexVersion MAGNITUDE_STORED_INDEX_VERSION = IndexVersions.V_7_5_0;
public static final IndexVersion INDEXED_BY_DEFAULT_INDEX_VERSION = IndexVersions.FIRST_DETACHED_INDEX_VERSION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ private EnterpriseGeoIpTask() {
}

public static final String ENTERPRISE_GEOIP_DOWNLOADER = "enterprise-geoip-downloader";
public static final NodeFeature GEOIP_DOWNLOADER_DATABASE_CONFIGURATION = new NodeFeature("geoip.downloader.database.configuration");
public static final NodeFeature GEOIP_DOWNLOADER_DATABASE_CONFIGURATION = new NodeFeature(
"geoip.downloader.database.configuration",
true
);

public static class EnterpriseGeoIpTaskParams implements PersistentTaskParams {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@
public class IngestGeoIpFeatures implements FeatureSpecification {

public static final NodeFeature GET_DATABASE_CONFIGURATION_ACTION_MULTI_NODE = new NodeFeature(
"get_database_configuration_action.multi_node"
"get_database_configuration_action.multi_node",
true
);

public static final NodeFeature PUT_DATABASE_CONFIGURATION_ACTION_IPINFO = new NodeFeature("put_database_configuration_action.ipinfo");
public static final NodeFeature PUT_DATABASE_CONFIGURATION_ACTION_IPINFO = new NodeFeature(
"put_database_configuration_action.ipinfo",
true
);

public Set<NodeFeature> getFeatures() {
return Set.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.Set;

public class RepositoriesFeatures implements FeatureSpecification {
public static final NodeFeature SUPPORTS_REPOSITORIES_USAGE_STATS = new NodeFeature("repositories.supports_usage_stats");
public static final NodeFeature SUPPORTS_REPOSITORIES_USAGE_STATS = new NodeFeature("repositories.supports_usage_stats", true);

@Override
public Set<NodeFeature> getFeatures() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class FileSettingsFeatures implements FeatureSpecification {

// Although file settings were supported starting in 8.4.0, this is really about whether file settings
// are used in readiness.
public static final NodeFeature FILE_SETTINGS_SUPPORTED = new NodeFeature("file_settings");
public static final NodeFeature FILE_SETTINGS_SUPPORTED = new NodeFeature("file_settings", true);

@Override
public Set<NodeFeature> getFeatures() {
Expand Down
Loading

0 comments on commit 75d1050

Please sign in to comment.