diff --git a/modules/data-streams/src/main/java/org/elasticsearch/datastreams/options/action/GetDataStreamOptionsAction.java b/modules/data-streams/src/main/java/org/elasticsearch/datastreams/options/action/GetDataStreamOptionsAction.java index a946376a28cad..85b03473954e3 100644 --- a/modules/data-streams/src/main/java/org/elasticsearch/datastreams/options/action/GetDataStreamOptionsAction.java +++ b/modules/data-streams/src/main/java/org/elasticsearch/datastreams/options/action/GetDataStreamOptionsAction.java @@ -8,7 +8,7 @@ */ package org.elasticsearch.datastreams.options.action; -import org.elasticsearch.TransportVersions; +import org.elasticsearch.TransportVersion; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; @@ -45,6 +45,10 @@ private GetDataStreamOptionsAction() {/* no instances */} public static class Request extends MasterNodeReadRequest implements IndicesRequest.Replaceable { + private static final TransportVersion DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS = TransportVersion.fromName( + "data_stream_options_api_remove_include_defaults" + ); + private String[] names; private IndicesOptions indicesOptions = IndicesOptions.builder() .concreteTargetOptions(IndicesOptions.ConcreteTargetOptions.ERROR_WHEN_UNAVAILABLE_TARGETS) @@ -79,7 +83,8 @@ public Request(StreamInput in) throws IOException { super(in); this.names = in.readOptionalStringArray(); this.indicesOptions = IndicesOptions.readIndicesOptions(in); - if (in.getTransportVersion().before(TransportVersions.DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS_8_19)) { + // This boolean was removed in 8.19 + if (in.getTransportVersion().supports(DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS) == false) { in.readBoolean(); } } @@ -89,7 +94,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeOptionalStringArray(names); indicesOptions.writeIndicesOptions(out); - if (out.getTransportVersion().before(TransportVersions.DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS_8_19)) { + if (out.getTransportVersion().supports(DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS) == false) { out.writeBoolean(false); } } diff --git a/server/src/main/java/org/elasticsearch/TransportVersions.java b/server/src/main/java/org/elasticsearch/TransportVersions.java index 542fab2718948..9c24eaf3b416b 100644 --- a/server/src/main/java/org/elasticsearch/TransportVersions.java +++ b/server/src/main/java/org/elasticsearch/TransportVersions.java @@ -221,16 +221,6 @@ static TransportVersion def(int id) { public static final TransportVersion ML_INFERENCE_VERTEXAI_CHATCOMPLETION_ADDED_8_19 = def(8_841_0_38); public static final TransportVersion INFERENCE_CUSTOM_SERVICE_ADDED_8_19 = def(8_841_0_39); public static final TransportVersion IDP_CUSTOM_SAML_ATTRIBUTES_ADDED_8_19 = def(8_841_0_40); - public static final TransportVersion DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS_8_19 = def(8_841_0_41); - public static final TransportVersion JOIN_ON_ALIASES_8_19 = def(8_841_0_42); - public static final TransportVersion ILM_ADD_SKIP_SETTING_8_19 = def(8_841_0_43); - public static final TransportVersion ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY_8_19 = def(8_841_0_44); - public static final TransportVersion ESQL_QUERY_PLANNING_DURATION_8_19 = def(8_841_0_45); - public static final TransportVersion SEARCH_SOURCE_EXCLUDE_VECTORS_PARAM_8_19 = def(8_841_0_46); - public static final TransportVersion ML_INFERENCE_MISTRAL_CHAT_COMPLETION_ADDED_8_19 = def(8_841_0_47); - public static final TransportVersion ML_INFERENCE_ELASTIC_RERANK_ADDED_8_19 = def(8_841_0_48); - public static final TransportVersion NONE_CHUNKING_STRATEGY_8_19 = def(8_841_0_49); - public static final TransportVersion IDP_CUSTOM_SAML_ATTRIBUTES_ALLOW_LIST_8_19 = def(8_841_0_50); /* * STOP! READ THIS FIRST! No, really, diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java index 3a87de8d5b2cf..586ba3334c99c 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java @@ -10,7 +10,6 @@ package org.elasticsearch.search.fetch.subphase; import org.elasticsearch.TransportVersion; -import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -46,6 +45,11 @@ public class FetchSourceContext implements Writeable, ToXContentObject { Strings.EMPTY_ARRAY, Strings.EMPTY_ARRAY ); + + private static final TransportVersion SEARCH_SOURCE_EXCLUDE_VECTORS_PARAM = TransportVersion.fromName( + "search_source_exclude_vectors_param" + ); + private final boolean fetchSource; private final String[] includes; private final String[] excludes; @@ -97,7 +101,7 @@ public void writeTo(StreamOutput out) throws IOException { } private static boolean isVersionCompatibleWithExcludeVectors(TransportVersion version) { - return version.onOrAfter(TransportVersions.SEARCH_SOURCE_EXCLUDE_VECTORS_PARAM_8_19); + return version.supports(SEARCH_SOURCE_EXCLUDE_VECTORS_PARAM); } public boolean fetchSource() { diff --git a/server/src/main/resources/transport/definitions/referable/data_stream_options_api_remove_include_defaults.csv b/server/src/main/resources/transport/definitions/referable/data_stream_options_api_remove_include_defaults.csv new file mode 100644 index 0000000000000..d30e8a8ad79a9 --- /dev/null +++ b/server/src/main/resources/transport/definitions/referable/data_stream_options_api_remove_include_defaults.csv @@ -0,0 +1,9 @@ +# We have taken a donor primary id from +# another collapsed primary id since +# we only have a patch id here given that +# this feature was removed in 8.19. +# This works because our donor was taken +# prior to 9.1.0 release. So this still +# honors bwc from 8.19 -> 9.1 and +# 9.0 -> 9.x. +9081000,8841041 diff --git a/server/src/main/resources/transport/definitions/referable/esql_query_planning_duration.csv b/server/src/main/resources/transport/definitions/referable/esql_query_planning_duration.csv new file mode 100644 index 0000000000000..11d918930681c --- /dev/null +++ b/server/src/main/resources/transport/definitions/referable/esql_query_planning_duration.csv @@ -0,0 +1 @@ +9055000,8841045 diff --git a/server/src/main/resources/transport/definitions/referable/esql_regex_match_with_case_insensitivity.csv b/server/src/main/resources/transport/definitions/referable/esql_regex_match_with_case_insensitivity.csv new file mode 100644 index 0000000000000..7960a93be2214 --- /dev/null +++ b/server/src/main/resources/transport/definitions/referable/esql_regex_match_with_case_insensitivity.csv @@ -0,0 +1 @@ +9086000,8841044 diff --git a/server/src/main/resources/transport/definitions/referable/idp_custom_saml_attributes_allow_list.csv b/server/src/main/resources/transport/definitions/referable/idp_custom_saml_attributes_allow_list.csv new file mode 100644 index 0000000000000..47e0eeca991aa --- /dev/null +++ b/server/src/main/resources/transport/definitions/referable/idp_custom_saml_attributes_allow_list.csv @@ -0,0 +1 @@ +9091000,8841050 diff --git a/server/src/main/resources/transport/definitions/referable/ilm_add_skip_setting.csv b/server/src/main/resources/transport/definitions/referable/ilm_add_skip_setting.csv new file mode 100644 index 0000000000000..1349e0a9861f6 --- /dev/null +++ b/server/src/main/resources/transport/definitions/referable/ilm_add_skip_setting.csv @@ -0,0 +1 @@ +9089000,8841043 diff --git a/server/src/main/resources/transport/definitions/referable/join_on_aliases.csv b/server/src/main/resources/transport/definitions/referable/join_on_aliases.csv new file mode 100644 index 0000000000000..090404bd5c353 --- /dev/null +++ b/server/src/main/resources/transport/definitions/referable/join_on_aliases.csv @@ -0,0 +1 @@ +9088000,8841042 diff --git a/server/src/main/resources/transport/definitions/referable/ml_inference_elastic_rerank.csv b/server/src/main/resources/transport/definitions/referable/ml_inference_elastic_rerank.csv new file mode 100644 index 0000000000000..c277b001af131 --- /dev/null +++ b/server/src/main/resources/transport/definitions/referable/ml_inference_elastic_rerank.csv @@ -0,0 +1 @@ +9094000,8841048 diff --git a/server/src/main/resources/transport/definitions/referable/ml_inference_mistral_chat_completion_added.csv b/server/src/main/resources/transport/definitions/referable/ml_inference_mistral_chat_completion_added.csv new file mode 100644 index 0000000000000..23c8f42ef4ec6 --- /dev/null +++ b/server/src/main/resources/transport/definitions/referable/ml_inference_mistral_chat_completion_added.csv @@ -0,0 +1 @@ +9090000,8841047 diff --git a/server/src/main/resources/transport/definitions/referable/none_chunking_strategy.csv b/server/src/main/resources/transport/definitions/referable/none_chunking_strategy.csv new file mode 100644 index 0000000000000..24864404b34aa --- /dev/null +++ b/server/src/main/resources/transport/definitions/referable/none_chunking_strategy.csv @@ -0,0 +1 @@ +9097000,8841049 diff --git a/server/src/main/resources/transport/definitions/referable/search_source_exclude_vectors_param.csv b/server/src/main/resources/transport/definitions/referable/search_source_exclude_vectors_param.csv new file mode 100644 index 0000000000000..9820bc5f20743 --- /dev/null +++ b/server/src/main/resources/transport/definitions/referable/search_source_exclude_vectors_param.csv @@ -0,0 +1 @@ +9092000,8841046 diff --git a/server/src/main/resources/transport/definitions/unreferable/dead_esql_query_planning_duration.csv b/server/src/main/resources/transport/definitions/unreferable/dead_esql_query_planning_duration.csv new file mode 100644 index 0000000000000..c691bd6aa064d --- /dev/null +++ b/server/src/main/resources/transport/definitions/unreferable/dead_esql_query_planning_duration.csv @@ -0,0 +1 @@ +9051000 diff --git a/server/src/main/resources/transport/definitions/unreferable/dead_settings_in_data_streams.csv b/server/src/main/resources/transport/definitions/unreferable/dead_settings_in_data_streams.csv deleted file mode 100644 index 06d0c5fec9c3b..0000000000000 --- a/server/src/main/resources/transport/definitions/unreferable/dead_settings_in_data_streams.csv +++ /dev/null @@ -1 +0,0 @@ -9081000 diff --git a/server/src/test/java/org/elasticsearch/TransportVersionTests.java b/server/src/test/java/org/elasticsearch/TransportVersionTests.java index fd79050b67bb8..f73f622fb8083 100644 --- a/server/src/test/java/org/elasticsearch/TransportVersionTests.java +++ b/server/src/test/java/org/elasticsearch/TransportVersionTests.java @@ -467,7 +467,7 @@ public void testTransportVersionsLocked() { "TransportVersions.java is locked. Generate transport versions with TransportVersion.fromName " + "and generateTransportVersion gradle task", versions.get(versions.size() - 1).id(), - equalTo(8_841_0_50) + equalTo(8_841_0_40) ); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponse.java index 79ebdb44dc9d6..322ce3141ff63 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponse.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ilm; +import org.elasticsearch.TransportVersion; import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; @@ -123,6 +124,8 @@ public class IndexLifecycleExplainResponse implements ToXContentObject, Writeabl PARSER.declareBoolean(ConstructingObjectParser.optionalConstructorArg(), SKIP_NAME); } + private static final TransportVersion ILM_ADD_SKIP_SETTING = TransportVersion.fromName("ilm_add_skip_setting"); + private final String index; private final Long indexCreationDate; private final String policyName; @@ -342,7 +345,7 @@ public IndexLifecycleExplainResponse(StreamInput in) throws IOException { } else { previousStepInfo = null; } - if (in.getTransportVersion().onOrAfter(TransportVersions.ILM_ADD_SKIP_SETTING_8_19)) { + if (in.getTransportVersion().supports(ILM_ADD_SKIP_SETTING)) { skip = in.readBoolean(); } else { skip = false; @@ -397,7 +400,7 @@ public void writeTo(StreamOutput out) throws IOException { if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_16_0)) { out.writeOptionalBytesReference(previousStepInfo); } - if (out.getTransportVersion().onOrAfter(TransportVersions.ILM_ADD_SKIP_SETTING_8_19)) { + if (out.getTransportVersion().supports(ILM_ADD_SKIP_SETTING)) { out.writeBoolean(skip); } } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java index 7b5e84522e2dd..757ca5769791a 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.esql.action; +import org.elasticsearch.TransportVersion; import org.elasticsearch.TransportVersions; import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.common.io.stream.StreamInput; @@ -60,6 +61,8 @@ public class EsqlExecutionInfo implements ChunkedToXContentObject, Writeable { public static final ParseField TOOK = new ParseField("took"); public static final ParseField IS_PARTIAL_FIELD = new ParseField("is_partial"); + private static final TransportVersion ESQL_QUERY_PLANNING_DURATION = TransportVersion.fromName("esql_query_planning_duration"); + // Map key is clusterAlias on the primary querying cluster of a CCS minimize_roundtrips=true query // The Map itself is immutable after construction - all Clusters will be accounted for at the start of the search. // Updates to the Cluster occur with the updateCluster method that given the key to map transforms an @@ -128,7 +131,7 @@ public EsqlExecutionInfo(StreamInput in) throws IOException { this.skipUnavailablePredicate = Predicates.always(); this.relativeStart = null; - if (in.getTransportVersion().onOrAfter(TransportVersions.ESQL_QUERY_PLANNING_DURATION_8_19)) { + if (in.getTransportVersion().supports(ESQL_QUERY_PLANNING_DURATION)) { this.overallTimeSpan = in.readOptional(TimeSpan::readFrom); this.planningTimeSpan = in.readOptional(TimeSpan::readFrom); } @@ -148,7 +151,7 @@ public void writeTo(StreamOutput out) throws IOException { if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_RESPONSE_PARTIAL)) { out.writeBoolean(isPartial); } - if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_QUERY_PLANNING_DURATION_8_19)) { + if (out.getTransportVersion().supports(ESQL_QUERY_PLANNING_DURATION)) { out.writeOptionalWriteable(overallTimeSpan); out.writeOptionalWriteable(planningTimeSpan); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/LookupFromIndexService.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/LookupFromIndexService.java index a2b4ba12b0a69..25ec3e74e14d9 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/LookupFromIndexService.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/LookupFromIndexService.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.esql.enrich; +import org.elasticsearch.TransportVersion; import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.service.ClusterService; @@ -127,6 +128,8 @@ public static class Request extends AbstractLookupService.Request { protected static class TransportRequest extends AbstractLookupService.TransportRequest { private final String matchField; + private static final TransportVersion JOIN_ON_ALIASES = TransportVersion.fromName("join_on_aliases"); + TransportRequest( String sessionId, ShardId shardId, @@ -148,7 +151,7 @@ static TransportRequest readFrom(StreamInput in, BlockFactory blockFactory) thro ShardId shardId = new ShardId(in); String indexPattern; - if (in.getTransportVersion().onOrAfter(TransportVersions.JOIN_ON_ALIASES_8_19)) { + if (in.getTransportVersion().supports(JOIN_ON_ALIASES)) { indexPattern = in.readString(); } else { indexPattern = shardId.getIndexName(); @@ -187,7 +190,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(sessionId); out.writeWriteable(shardId); - if (out.getTransportVersion().onOrAfter(TransportVersions.JOIN_ON_ALIASES_8_19)) { + if (out.getTransportVersion().supports(JOIN_ON_ALIASES)) { out.writeString(indexPattern); } else if (indexPattern.equals(shardId.getIndexName()) == false) { throw new EsqlIllegalArgumentException("Aliases and index patterns are not allowed for LOOKUP JOIN [{}]", indexPattern); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/regex/RegexMatch.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/regex/RegexMatch.java index 86b868e9833e5..5820d91dfa5bf 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/regex/RegexMatch.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/regex/RegexMatch.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.string.regex; import org.apache.lucene.util.automaton.Automata; -import org.elasticsearch.TransportVersions; +import org.elasticsearch.TransportVersion; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.compute.operator.EvalOperator; @@ -30,6 +30,10 @@ abstract class RegexMatch

extends org.elasticsearch.xpack.esql.core.expression.predicate.regex.RegexMatch< P> implements EvaluatorMapper, TranslationAware.SingleValueTranslationAware { + private static final TransportVersion ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY = TransportVersion.fromName( + "esql_regex_match_with_case_insensitivity" + ); + abstract String name(); RegexMatch(Source source, Expression field, P pattern, boolean caseInsensitive) { @@ -72,14 +76,14 @@ public String nodeString() { } void serializeCaseInsensitivity(StreamOutput out) throws IOException { - if (out.getTransportVersion().before(TransportVersions.ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY_8_19)) { + if (out.getTransportVersion().supports(ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY) == false) { if (caseInsensitive()) { // The plan has been optimized to run a case-insensitive match, which the remote peer cannot be notified of. Simply avoiding // the serialization of the boolean would result in wrong results. throw new EsqlIllegalArgumentException( name() + " with case insensitivity is not supported in peer node's version [{}]. Upgrade to version [{}] or newer.", out.getTransportVersion(), - TransportVersions.ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY_8_19 + ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY ); } // else: write nothing, the remote peer can execute the case-sensitive query } else { @@ -88,6 +92,6 @@ void serializeCaseInsensitivity(StreamOutput out) throws IOException { } static boolean deserializeCaseInsensitivity(StreamInput in) throws IOException { - return in.getTransportVersion().onOrAfter(TransportVersions.ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY_8_19) && in.readBoolean(); + return in.getTransportVersion().supports(ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY) && in.readBoolean(); } } diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocument.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocument.java index 1b0441c1363f5..9cd1155bc9ef3 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocument.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocument.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.idp.saml.sp; import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.TransportVersion; import org.elasticsearch.common.Strings; import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.io.stream.StreamInput; @@ -42,8 +43,6 @@ import java.util.TreeSet; import java.util.function.BiConsumer; -import static org.elasticsearch.TransportVersions.IDP_CUSTOM_SAML_ATTRIBUTES_ALLOW_LIST_8_19; - /** * This class models the storage of a {@link SamlServiceProvider} as an Elasticsearch document. */ @@ -53,6 +52,10 @@ public class SamlServiceProviderDocument implements ToXContentObject, Writeable public static final String SIGN_LOGOUT = "logout"; private static final Set ALLOWED_SIGN_MESSAGES = Set.of(SIGN_AUTHN, SIGN_LOGOUT); + private static final TransportVersion IDP_CUSTOM_SAML_ATTRIBUTES_ALLOW_LIST = TransportVersion.fromName( + "idp_custom_saml_attributes_allow_list" + ); + public static class Privileges { public String resource; // we use a sorted set so that the order is consistent in XContent APIs @@ -276,7 +279,7 @@ public SamlServiceProviderDocument(StreamInput in) throws IOException { attributeNames.name = in.readOptionalString(); attributeNames.roles = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(IDP_CUSTOM_SAML_ATTRIBUTES_ALLOW_LIST_8_19)) { + if (in.getTransportVersion().supports(IDP_CUSTOM_SAML_ATTRIBUTES_ALLOW_LIST)) { attributeNames.extensions = in.readCollectionAsImmutableSet(StreamInput::readString); } @@ -305,7 +308,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(attributeNames.name); out.writeOptionalString(attributeNames.roles); - if (out.getTransportVersion().onOrAfter(IDP_CUSTOM_SAML_ATTRIBUTES_ALLOW_LIST_8_19)) { + if (out.getTransportVersion().supports(IDP_CUSTOM_SAML_ATTRIBUTES_ALLOW_LIST)) { out.writeStringCollection(attributeNames.extensions); } diff --git a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java index df869c92bcbe6..d242b525df13e 100644 --- a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java +++ b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java @@ -41,6 +41,10 @@ public class SamlServiceProviderDocumentTests extends IdpSamlTestCase { + private static final TransportVersion IDP_CUSTOM_SAML_ATTRIBUTES_ALLOW_LIST = TransportVersion.fromName( + "idp_custom_saml_attributes_allow_list" + ); + public void testValidationFailuresForMissingFields() throws Exception { final SamlServiceProviderDocument doc = new SamlServiceProviderDocument(); doc.setDocId(randomAlphaOfLength(16)); @@ -96,7 +100,7 @@ public void testSerializationBeforeExtensionAttributes() throws Exception { final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), TransportVersions.V_7_7_0, - TransportVersionUtils.getPreviousVersion(TransportVersions.IDP_CUSTOM_SAML_ATTRIBUTES_ALLOW_LIST_8_19) + TransportVersionUtils.getPreviousVersion(IDP_CUSTOM_SAML_ATTRIBUTES_ALLOW_LIST) ); final SamlServiceProviderDocument copy = copyWriteable( original, @@ -183,7 +187,7 @@ private SamlServiceProviderDocument assertXContentRoundTrip(SamlServiceProviderD private SamlServiceProviderDocument assertSerializationRoundTrip(SamlServiceProviderDocument doc) throws IOException { final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersions.IDP_CUSTOM_SAML_ATTRIBUTES_ALLOW_LIST_8_19, + IDP_CUSTOM_SAML_ATTRIBUTES_ALLOW_LIST, TransportVersion.current() ); final SamlServiceProviderDocument read = copyWriteable( diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/chunking/NoneChunkingSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/chunking/NoneChunkingSettings.java index 05a621c3ac205..d0e0da2321f5b 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/chunking/NoneChunkingSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/chunking/NoneChunkingSettings.java @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.inference.chunking; import org.elasticsearch.TransportVersion; -import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.io.stream.StreamOutput; @@ -30,6 +29,8 @@ public class NoneChunkingSettings implements ChunkingSettings { private static final ChunkingStrategy STRATEGY = ChunkingStrategy.NONE; private static final Set VALID_KEYS = Set.of(ChunkingSettingsOptions.STRATEGY.toString()); + private static final TransportVersion NONE_CHUNKING_STRATEGY = TransportVersion.fromName("none_chunking_strategy"); + private NoneChunkingSettings() {} @Override @@ -44,7 +45,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.NONE_CHUNKING_STRATEGY_8_19; + return NONE_CHUNKING_STRATEGY; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elastic/rerank/ElasticInferenceServiceRerankServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elastic/rerank/ElasticInferenceServiceRerankServiceSettings.java index aefce277ee18d..9af54cb01afa9 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elastic/rerank/ElasticInferenceServiceRerankServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elastic/rerank/ElasticInferenceServiceRerankServiceSettings.java @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.inference.services.elastic.rerank; import org.elasticsearch.TransportVersion; -import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -34,8 +33,8 @@ public class ElasticInferenceServiceRerankServiceSettings extends FilteredXConte ElasticInferenceServiceRateLimitServiceSettings { public static final String NAME = "elastic_rerank_service_settings"; - private static final RateLimitSettings DEFAULT_RATE_LIMIT_SETTINGS = new RateLimitSettings(500); + private static final TransportVersion ML_INFERENCE_ELASTIC_RERANK = TransportVersion.fromName("ml_inference_elastic_rerank"); public static ElasticInferenceServiceRerankServiceSettings fromMap(Map map, ConfigurationParseContext context) { ValidationException validationException = new ValidationException(); @@ -83,7 +82,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_ELASTIC_RERANK_ADDED_8_19; + return ML_INFERENCE_ELASTIC_RERANK; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/mistral/completion/MistralChatCompletionServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/mistral/completion/MistralChatCompletionServiceSettings.java index 07db86f51ce8d..16ceb3c9af0aa 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/mistral/completion/MistralChatCompletionServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/mistral/completion/MistralChatCompletionServiceSettings.java @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.inference.services.mistral.completion; import org.elasticsearch.TransportVersion; -import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -34,6 +33,9 @@ */ public class MistralChatCompletionServiceSettings extends FilteredXContentObject implements ServiceSettings { public static final String NAME = "mistral_completions_service_settings"; + private static final TransportVersion ML_INFERENCE_MISTRAL_CHAT_COMPLETION_ADDED = TransportVersion.fromName( + "ml_inference_mistral_chat_completion_added" + ); private final String modelId; private final RateLimitSettings rateLimitSettings; @@ -78,7 +80,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_MISTRAL_CHAT_COMPLETION_ADDED_8_19; + return ML_INFERENCE_MISTRAL_CHAT_COMPLETION_ADDED; } @Override