From 32ddbb3449d19a0970b96eefe960d4ab006357fc Mon Sep 17 00:00:00 2001 From: Simon Cooper Date: Thu, 17 Oct 2024 08:36:50 +0100 Subject: [PATCH] Squash transport versions into 8.15 (#114827) --- .../ingest/geoip/GeoIpTaskState.java | 3 +- .../search/rank/FieldBasedRerankerIT.java | 2 +- .../MockedRequestActionBasedRerankerIT.java | 2 +- .../elasticsearch/ElasticsearchException.java | 2 +- .../org/elasticsearch/TransportVersions.java | 78 +------------------ .../TransportGetAllocationStatsAction.java | 4 +- .../node/stats/TransportNodesStatsAction.java | 6 +- .../cleanup/CleanupRepositoryRequest.java | 4 +- .../delete/DeleteSnapshotRequest.java | 4 +- .../delete/TransportDeleteSnapshotAction.java | 3 +- .../indices/create/CreateIndexRequest.java | 4 +- .../segments/IndicesSegmentsRequest.java | 4 +- .../admin/indices/stats/CommonStats.java | 3 +- .../action/bulk/BulkShardRequest.java | 4 +- .../ExplainIndexDataStreamLifecycle.java | 4 +- .../GetDataStreamLifecycleAction.java | 4 +- .../action/ingest/SimulateIndexResponse.java | 4 +- .../support/master/MasterNodeRequest.java | 4 +- .../elasticsearch/cluster/ClusterState.java | 4 +- .../action/shard/ShardStateAction.java | 6 +- .../cluster/coordination/JoinStatus.java | 4 +- .../cluster/metadata/DataStream.java | 4 +- .../cluster/metadata/IndexMetadata.java | 24 +++--- .../metadata/MetadataCreateIndexService.java | 2 +- .../index/stats/IndexingPressureStats.java | 4 +- .../org/elasticsearch/ingest/IngestStats.java | 6 +- .../search/builder/PointInTimeBuilder.java | 4 +- .../search/fetch/ShardFetchSearchRequest.java | 4 +- .../rank/feature/RankFeatureShardResult.java | 2 +- .../search/vectors/ExactKnnQueryBuilder.java | 4 +- .../vectors/KnnScoreDocQueryBuilder.java | 4 +- .../search/vectors/KnnSearchBuilder.java | 4 +- .../search/vectors/KnnVectorQueryBuilder.java | 4 +- .../elasticsearch/TransportVersionTests.java | 2 +- .../NodesStatsRequestParametersTests.java | 2 +- .../indices/close/CloseIndexRequestTests.java | 4 +- ...dStartedClusterStateTaskExecutorTests.java | 2 +- .../action/shard/ShardStateActionTests.java | 4 +- .../ClusterSerializationTests.java | 4 +- .../rank/RankFeatureShardPhaseTests.java | 2 +- .../ClusterStateCreationUtils.java | 10 +-- .../action/GetAutoscalingCapacityAction.java | 4 +- .../DataStreamFeatureSetUsage.java | 6 +- .../core/enrich/action/EnrichStatsAction.java | 6 +- .../action/DeleteInferenceEndpointAction.java | 8 +- .../inference/results/RankedDocsResults.java | 6 +- .../core/ml/action/InferModelAction.java | 4 +- .../inference/TrainedModelCacheMetadata.java | 2 +- .../autodetect/state/ModelSizeStats.java | 4 +- .../core/rollup/RollupFeatureSetUsage.java | 6 +- .../settings/GetSecuritySettingsAction.java | 4 +- .../UpdateSecuritySettingsAction.java | 4 +- .../user/GetUserPrivilegesResponse.java | 10 ++- .../core/security/authc/Authentication.java | 2 +- .../core/security/authz/RoleDescriptor.java | 10 ++- .../security/authz/RoleMappingMetadata.java | 2 +- .../permission/RemoteClusterPermissions.java | 4 +- .../support/SecurityMigrationTaskParams.java | 6 +- .../actions/put/GetWatcherSettingsAction.java | 4 +- .../put/UpdateWatcherSettingsAction.java | 4 +- .../results/RankedDocsResultsTests.java | 5 +- ...TrainedModelsStatsActionResponseTests.java | 2 +- .../action/InferModelActionRequestTests.java | 2 +- .../user/GetUserPrivilegesResponseTests.java | 3 +- .../security/authc/AuthenticationTests.java | 3 +- .../security/authz/RoleDescriptorTests.java | 14 ++-- .../RemoteClusterPermissionsTests.java | 6 +- .../xpack/application/rules/QueryRule.java | 4 +- .../application/rules/RuleQueryBuilder.java | 4 +- ...RuleActionResponseBWCSerializingTests.java | 4 +- ...esetActionResponseBWCSerializingTests.java | 2 +- ...yRuleActionRequestBWCSerializingTests.java | 4 +- ...lesetActionRequestBWCSerializingTests.java | 2 +- .../compute/data/AbstractArrayBlock.java | 3 +- ...AbstractPageMappingToIteratorOperator.java | 2 +- .../esql/enrich/ResolvedEnrichPolicy.java | 4 +- .../function/UnsupportedAttribute.java | 6 +- .../xpack/esql/io/stream/PlanStreamInput.java | 4 +- .../esql/io/stream/PlanStreamOutput.java | 4 +- .../xpack/esql/plan/logical/Aggregate.java | 4 +- .../xpack/esql/plan/logical/EsRelation.java | 6 +- .../xpack/esql/plugin/EsqlFeatures.java | 1 - .../xpack/esql/session/Configuration.java | 4 +- .../queries/SemanticQueryBuilder.java | 2 +- .../TextSimilarityRankBuilder.java | 2 +- .../AmazonBedrockSecretSettings.java | 4 +- .../amazonbedrock/AmazonBedrockService.java | 4 +- .../AmazonBedrockServiceSettings.java | 4 +- ...azonBedrockChatCompletionTaskSettings.java | 4 +- .../services/anthropic/AnthropicService.java | 2 +- .../AnthropicChatCompletionTaskSettings.java | 2 +- .../azureaistudio/AzureAiStudioService.java | 2 +- ...AiStudioChatCompletionServiceSettings.java | 2 +- ...zureAiStudioEmbeddingsServiceSettings.java | 2 +- .../azureopenai/AzureOpenAiService.java | 2 +- .../AzureOpenAiCompletionServiceSettings.java | 2 +- .../AzureOpenAiCompletionTaskSettings.java | 2 +- .../AzureOpenAiEmbeddingsServiceSettings.java | 4 +- .../services/cohere/CohereService.java | 2 +- .../cohere/CohereServiceSettings.java | 4 +- .../CohereCompletionServiceSettings.java | 2 +- .../rerank/CohereRerankServiceSettings.java | 4 +- ...dInternalTextEmbeddingServiceSettings.java | 4 +- .../googleaistudio/GoogleAiStudioService.java | 2 +- ...ogleAiStudioCompletionServiceSettings.java | 2 +- ...ogleAiStudioEmbeddingsServiceSettings.java | 2 +- .../GoogleVertexAiSecretSettings.java | 2 +- .../googlevertexai/GoogleVertexAiService.java | 2 +- ...ogleVertexAiEmbeddingsServiceSettings.java | 2 +- .../GoogleVertexAiEmbeddingsTaskSettings.java | 2 +- .../GoogleVertexAiRerankServiceSettings.java | 2 +- .../GoogleVertexAiRerankTaskSettings.java | 2 +- .../huggingface/HuggingFaceService.java | 2 +- .../HuggingFaceServiceSettings.java | 4 +- .../HuggingFaceElserServiceSettings.java | 4 +- .../services/mistral/MistralService.java | 4 +- .../MistralEmbeddingsServiceSettings.java | 4 +- .../services/openai/OpenAiService.java | 2 +- .../OpenAiChatCompletionServiceSettings.java | 4 +- .../OpenAiEmbeddingsServiceSettings.java | 4 +- .../CohereRerankServiceSettingsTests.java | 2 +- .../ml/queries/SparseVectorQueryBuilder.java | 2 +- .../xpack/security/authc/ApiKeyService.java | 2 +- .../authz/store/NativeRolesStore.java | 35 +++++---- .../security/authc/ApiKeyServiceTests.java | 2 +- .../authz/store/NativeRolesStoreTests.java | 5 +- .../RolesBackwardsCompatibilityIT.java | 11 +-- 127 files changed, 254 insertions(+), 345 deletions(-) diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java index 09ed10568ce8d..47ca79e3cb3b9 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java @@ -44,8 +44,7 @@ public class GeoIpTaskState implements PersistentTaskState, VersionedNamedWriteable { private static boolean includeSha256(TransportVersion version) { - return version.isPatchFrom(TransportVersions.ENTERPRISE_GEOIP_DOWNLOADER_BACKPORT_8_15) - || version.onOrAfter(TransportVersions.ENTERPRISE_GEOIP_DOWNLOADER); + return version.isPatchFrom(TransportVersions.V_8_15_0) || version.onOrAfter(TransportVersions.ENTERPRISE_GEOIP_DOWNLOADER); } private static final ParseField DATABASES = new ParseField("databases"); diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/rank/FieldBasedRerankerIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/rank/FieldBasedRerankerIT.java index 027b223e8c4ef..c8c1f50444c1d 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/rank/FieldBasedRerankerIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/rank/FieldBasedRerankerIT.java @@ -234,7 +234,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.RANK_FEATURE_PHASE_ADDED; + return TransportVersions.V_8_15_0; } } diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/rank/MockedRequestActionBasedRerankerIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/rank/MockedRequestActionBasedRerankerIT.java index ce9ce7b9cf4cf..dbdd6e8c50027 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/rank/MockedRequestActionBasedRerankerIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/rank/MockedRequestActionBasedRerankerIT.java @@ -424,7 +424,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.RANK_FEATURE_PHASE_ADDED; + return TransportVersions.V_8_15_0; } } diff --git a/server/src/main/java/org/elasticsearch/ElasticsearchException.java b/server/src/main/java/org/elasticsearch/ElasticsearchException.java index 4119e12d45f6c..32198ba7584be 100644 --- a/server/src/main/java/org/elasticsearch/ElasticsearchException.java +++ b/server/src/main/java/org/elasticsearch/ElasticsearchException.java @@ -1917,7 +1917,7 @@ private enum ElasticsearchExceptionHandle { ResourceAlreadyUploadedException.class, ResourceAlreadyUploadedException::new, 181, - TransportVersions.ADD_RESOURCE_ALREADY_UPLOADED_EXCEPTION + TransportVersions.V_8_15_0 ), INGEST_PIPELINE_EXCEPTION( org.elasticsearch.ingest.IngestPipelineException.class, diff --git a/server/src/main/java/org/elasticsearch/TransportVersions.java b/server/src/main/java/org/elasticsearch/TransportVersions.java index d1d423dcc5405..dcf6f7aebdc65 100644 --- a/server/src/main/java/org/elasticsearch/TransportVersions.java +++ b/server/src/main/java/org/elasticsearch/TransportVersions.java @@ -102,80 +102,8 @@ static TransportVersion def(int id) { public static final TransportVersion V_8_13_0 = def(8_595_00_0); public static final TransportVersion V_8_13_4 = def(8_595_00_1); public static final TransportVersion V_8_14_0 = def(8_636_00_1); - // 8.15.0+ - public static final TransportVersion WATERMARK_THRESHOLDS_STATS = def(8_637_00_0); - public static final TransportVersion ENRICH_CACHE_ADDITIONAL_STATS = def(8_638_00_0); - public static final TransportVersion ML_INFERENCE_RATE_LIMIT_SETTINGS_ADDED = def(8_639_00_0); - public static final TransportVersion ML_TRAINED_MODEL_CACHE_METADATA_ADDED = def(8_640_00_0); - public static final TransportVersion TOP_LEVEL_KNN_SUPPORT_QUERY_NAME = def(8_641_00_0); - public static final TransportVersion INDEX_SEGMENTS_VECTOR_FORMATS = def(8_642_00_0); - public static final TransportVersion ADD_RESOURCE_ALREADY_UPLOADED_EXCEPTION = def(8_643_00_0); - public static final TransportVersion ESQL_MV_ORDERING_SORTED_ASCENDING = def(8_644_00_0); - public static final TransportVersion ESQL_PAGE_MAPPING_TO_ITERATOR = def(8_645_00_0); - public static final TransportVersion BINARY_PIT_ID = def(8_646_00_0); - public static final TransportVersion SECURITY_ROLE_MAPPINGS_IN_CLUSTER_STATE = def(8_647_00_0); - public static final TransportVersion ESQL_REQUEST_TABLES = def(8_648_00_0); - public static final TransportVersion ROLE_REMOTE_CLUSTER_PRIVS = def(8_649_00_0); - public static final TransportVersion NO_GLOBAL_RETENTION_FOR_SYSTEM_DATA_STREAMS = def(8_650_00_0); - public static final TransportVersion SHUTDOWN_REQUEST_TIMEOUTS_FIX = def(8_651_00_0); - public static final TransportVersion INDEXING_PRESSURE_REQUEST_REJECTIONS_COUNT = def(8_652_00_0); - public static final TransportVersion ROLLUP_USAGE = def(8_653_00_0); - public static final TransportVersion SECURITY_ROLE_DESCRIPTION = def(8_654_00_0); - public static final TransportVersion ML_INFERENCE_AZURE_OPENAI_COMPLETIONS = def(8_655_00_0); - public static final TransportVersion JOIN_STATUS_AGE_SERIALIZATION = def(8_656_00_0); - public static final TransportVersion ML_RERANK_DOC_OPTIONAL = def(8_657_00_0); - public static final TransportVersion FAILURE_STORE_FIELD_PARITY = def(8_658_00_0); - public static final TransportVersion ML_INFERENCE_AZURE_AI_STUDIO = def(8_659_00_0); - public static final TransportVersion ML_INFERENCE_COHERE_COMPLETION_ADDED = def(8_660_00_0); - public static final TransportVersion ESQL_REMOVE_ES_SOURCE_OPTIONS = def(8_661_00_0); - public static final TransportVersion NODE_STATS_INGEST_BYTES = def(8_662_00_0); - public static final TransportVersion SEMANTIC_QUERY = def(8_663_00_0); - public static final TransportVersion GET_AUTOSCALING_CAPACITY_UNUSED_TIMEOUT = def(8_664_00_0); - public static final TransportVersion SIMULATE_VALIDATES_MAPPINGS = def(8_665_00_0); - public static final TransportVersion RULE_QUERY_RENAME = def(8_666_00_0); - public static final TransportVersion SPARSE_VECTOR_QUERY_ADDED = def(8_667_00_0); - public static final TransportVersion ESQL_ADD_INDEX_MODE_TO_SOURCE = def(8_668_00_0); - public static final TransportVersion GET_SHUTDOWN_STATUS_TIMEOUT = def(8_669_00_0); - public static final TransportVersion FAILURE_STORE_TELEMETRY = def(8_670_00_0); - public static final TransportVersion ADD_METADATA_FLATTENED_TO_ROLES = def(8_671_00_0); - public static final TransportVersion ML_INFERENCE_GOOGLE_AI_STUDIO_COMPLETION_ADDED = def(8_672_00_0); - public static final TransportVersion WATCHER_REQUEST_TIMEOUTS = def(8_673_00_0); - public static final TransportVersion ML_INFERENCE_ENHANCE_DELETE_ENDPOINT = def(8_674_00_0); - public static final TransportVersion ML_INFERENCE_GOOGLE_AI_STUDIO_EMBEDDINGS_ADDED = def(8_675_00_0); - public static final TransportVersion ADD_MISTRAL_EMBEDDINGS_INFERENCE = def(8_676_00_0); - public static final TransportVersion ML_CHUNK_INFERENCE_OPTION = def(8_677_00_0); - public static final TransportVersion RANK_FEATURE_PHASE_ADDED = def(8_678_00_0); - public static final TransportVersion RANK_DOC_IN_SHARD_FETCH_REQUEST = def(8_679_00_0); - public static final TransportVersion SECURITY_SETTINGS_REQUEST_TIMEOUTS = def(8_680_00_0); - public static final TransportVersion QUERY_RULE_CRUD_API_PUT = def(8_681_00_0); - public static final TransportVersion DROP_UNUSED_NODES_REQUESTS = def(8_682_00_0); - public static final TransportVersion QUERY_RULE_CRUD_API_GET_DELETE = def(8_683_00_0); - public static final TransportVersion MORE_LIGHTER_NODES_REQUESTS = def(8_684_00_0); - public static final TransportVersion DROP_UNUSED_NODES_IDS = def(8_685_00_0); - public static final TransportVersion DELETE_SNAPSHOTS_ASYNC_ADDED = def(8_686_00_0); - public static final TransportVersion VERSION_SUPPORTING_SPARSE_VECTOR_STATS = def(8_687_00_0); - public static final TransportVersion ML_AD_OUTPUT_MEMORY_ALLOCATOR_FIELD = def(8_688_00_0); - public static final TransportVersion FAILURE_STORE_LAZY_CREATION = def(8_689_00_0); - public static final TransportVersion SNAPSHOT_REQUEST_TIMEOUTS = def(8_690_00_0); - public static final TransportVersion INDEX_METADATA_MAPPINGS_UPDATED_VERSION = def(8_691_00_0); - public static final TransportVersion ML_INFERENCE_ELAND_SETTINGS_ADDED = def(8_692_00_0); - public static final TransportVersion ML_ANTHROPIC_INTEGRATION_ADDED = def(8_693_00_0); - public static final TransportVersion ML_INFERENCE_GOOGLE_VERTEX_AI_EMBEDDINGS_ADDED = def(8_694_00_0); - public static final TransportVersion EVENT_INGESTED_RANGE_IN_CLUSTER_STATE = def(8_695_00_0); - public static final TransportVersion ESQL_ADD_AGGREGATE_TYPE = def(8_696_00_0); - public static final TransportVersion SECURITY_MIGRATIONS_MIGRATION_NEEDED_ADDED = def(8_697_00_0); - public static final TransportVersion K_FOR_KNN_QUERY_ADDED = def(8_698_00_0); - public static final TransportVersion TEXT_SIMILARITY_RERANKER_RETRIEVER = def(8_699_00_0); - public static final TransportVersion ML_INFERENCE_GOOGLE_VERTEX_AI_RERANKING_ADDED = def(8_700_00_0); - public static final TransportVersion VERSIONED_MASTER_NODE_REQUESTS = def(8_701_00_0); - public static final TransportVersion ML_INFERENCE_AMAZON_BEDROCK_ADDED = def(8_702_00_0); - public static final TransportVersion ENTERPRISE_GEOIP_DOWNLOADER_BACKPORT_8_15 = def(8_702_00_1); - public static final TransportVersion FIX_VECTOR_SIMILARITY_INNER_HITS_BACKPORT_8_15 = def(8_702_00_2); - /** - * we made a single backport for ESQL_ES_FIELD_CACHED_SERIALIZATION and ESQL_ATTRIBUTE_CACHED_SERIALIZATION - * with only one TransportVersion entry - */ - public static final TransportVersion ESQL_ATTRIBUTE_CACHED_SERIALIZATION_8_15 = def(8_702_00_3); + public static final TransportVersion V_8_15_0 = def(8_702_00_2); + public static final TransportVersion V_8_15_2 = def(8_702_00_3); public static final TransportVersion ML_INFERENCE_DONT_DELETE_WHEN_SEMANTIC_TEXT_EXISTS = def(8_703_00_0); public static final TransportVersion INFERENCE_ADAPTIVE_ALLOCATIONS = def(8_704_00_0); public static final TransportVersion INDEX_REQUEST_UPDATE_BY_SCRIPT_ORIGIN = def(8_705_00_0); @@ -313,7 +241,7 @@ static TransportVersion def(int id) { * Reference to the minimum transport version that can be used with CCS. * This should be the transport version used by the previous minor release. */ - public static final TransportVersion MINIMUM_CCS_VERSION = FIX_VECTOR_SIMILARITY_INNER_HITS_BACKPORT_8_15; + public static final TransportVersion MINIMUM_CCS_VERSION = V_8_15_0; static final NavigableMap VERSION_IDS = getAllVersionIds(TransportVersions.class); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/TransportGetAllocationStatsAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/TransportGetAllocationStatsAction.java index 259a244bff919..e14f229f17acf 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/TransportGetAllocationStatsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/TransportGetAllocationStatsAction.java @@ -156,7 +156,7 @@ public Response(Map nodeAllocationStats, DiskThresh public Response(StreamInput in) throws IOException { super(in); this.nodeAllocationStats = in.readImmutableMap(StreamInput::readString, NodeAllocationStats::new); - if (in.getTransportVersion().onOrAfter(TransportVersions.WATERMARK_THRESHOLDS_STATS)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { this.diskThresholdSettings = in.readOptionalWriteable(DiskThresholdSettings::readFrom); } else { this.diskThresholdSettings = null; @@ -166,7 +166,7 @@ public Response(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { out.writeMap(nodeAllocationStats, StreamOutput::writeString, StreamOutput::writeWriteable); - if (out.getTransportVersion().onOrAfter(TransportVersions.WATERMARK_THRESHOLDS_STATS)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeOptionalWriteable(diskThresholdSettings); } else { assert diskThresholdSettings == null; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java index a4fda469da3a2..83769430d4142 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java @@ -186,8 +186,7 @@ public static class NodeStatsRequest extends TransportRequest { public NodeStatsRequest(StreamInput in) throws IOException { super(in); this.nodesStatsRequestParameters = new NodesStatsRequestParameters(in); - if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_13_0) - && in.getTransportVersion().before(TransportVersions.DROP_UNUSED_NODES_IDS)) { + if (in.getTransportVersion().between(TransportVersions.V_8_13_0, TransportVersions.V_8_15_0)) { in.readStringArray(); // formerly nodeIds, now unused } } @@ -214,8 +213,7 @@ public String getDescription() { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); nodesStatsRequestParameters.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_13_0) - && out.getTransportVersion().before(TransportVersions.DROP_UNUSED_NODES_IDS)) { + if (out.getTransportVersion().between(TransportVersions.V_8_13_0, TransportVersions.V_8_15_0)) { out.writeStringArray(Strings.EMPTY_ARRAY); // formerly nodeIds, now unused } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryRequest.java index 39fcb9fd53ac6..cdcf4bdad7b1a 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryRequest.java @@ -29,7 +29,7 @@ public CleanupRepositoryRequest(TimeValue masterNodeTimeout, TimeValue ackTimeou } public static CleanupRepositoryRequest readFrom(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersions.SNAPSHOT_REQUEST_TIMEOUTS)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { return new CleanupRepositoryRequest(in); } else { return new CleanupRepositoryRequest(TimeValue.THIRTY_SECONDS, TimeValue.THIRTY_SECONDS, in); @@ -48,7 +48,7 @@ public CleanupRepositoryRequest(TimeValue masterNodeTimeout, TimeValue ackTimeou @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersions.SNAPSHOT_REQUEST_TIMEOUTS)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { super.writeTo(out); } out.writeString(repository); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequest.java index 7d3c31a011acc..ab073f83e14da 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequest.java @@ -51,7 +51,7 @@ public DeleteSnapshotRequest(StreamInput in) throws IOException { super(in); repository = in.readString(); snapshots = in.readStringArray(); - if (in.getTransportVersion().onOrAfter(TransportVersions.DELETE_SNAPSHOTS_ASYNC_ADDED)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { waitForCompletion = in.readBoolean(); } } @@ -61,7 +61,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeString(repository); out.writeStringArray(snapshots); - if (out.getTransportVersion().onOrAfter(TransportVersions.DELETE_SNAPSHOTS_ASYNC_ADDED)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeBoolean(waitForCompletion); } else { assert waitForCompletion : "Using wait_for_completion parameter when it should have been disallowed"; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/delete/TransportDeleteSnapshotAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/delete/TransportDeleteSnapshotAction.java index b28c2a8e570ea..1dfd83aee0407 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/delete/TransportDeleteSnapshotAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/delete/TransportDeleteSnapshotAction.java @@ -64,8 +64,7 @@ protected ClusterBlockException checkBlock(DeleteSnapshotRequest request, Cluste @Override protected void doExecute(Task task, DeleteSnapshotRequest request, ActionListener listener) { - if (clusterService.state().getMinTransportVersion().before(TransportVersions.DELETE_SNAPSHOTS_ASYNC_ADDED) - && request.waitForCompletion() == false) { + if (clusterService.state().getMinTransportVersion().before(TransportVersions.V_8_15_0) && request.waitForCompletion() == false) { throw new UnsupportedOperationException("wait_for_completion parameter is not supported by all nodes in this cluster"); } super.doExecute(task, request, listener); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java index f4ac1a3fe907b..c233ed57b748e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java @@ -113,7 +113,7 @@ public CreateIndexRequest(StreamInput in) throws IOException { } else { requireDataStream = false; } - if (in.getTransportVersion().onOrAfter(TransportVersions.FAILURE_STORE_LAZY_CREATION)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { initializeFailureStore = in.readBoolean(); } else { initializeFailureStore = true; @@ -518,7 +518,7 @@ public void writeTo(StreamOutput out) throws IOException { if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_13_0)) { out.writeBoolean(this.requireDataStream); } - if (out.getTransportVersion().onOrAfter(TransportVersions.FAILURE_STORE_LAZY_CREATION)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeBoolean(this.initializeFailureStore); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java index 26447910cecfc..bdacfb0ab642d 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java @@ -34,7 +34,7 @@ public IndicesSegmentsRequest(StreamInput in) throws IOException { if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readBoolean(); // old 'verbose' option, since removed } - if (in.getTransportVersion().onOrAfter(TransportVersions.INDEX_SEGMENTS_VECTOR_FORMATS)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { this.includeVectorFormatsInfo = in.readBoolean(); } } @@ -59,7 +59,7 @@ public void writeTo(StreamOutput out) throws IOException { if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeBoolean(false); } - if (out.getTransportVersion().onOrAfter(TransportVersions.INDEX_SEGMENTS_VECTOR_FORMATS)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeBoolean(includeVectorFormatsInfo); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java index ddfe89cce01bf..1351674fffbfa 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java @@ -47,12 +47,11 @@ import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.TransportVersions.VERSION_SUPPORTING_SPARSE_VECTOR_STATS; - public class CommonStats implements Writeable, ToXContentFragment { private static final TransportVersion VERSION_SUPPORTING_NODE_MAPPINGS = TransportVersions.V_8_5_0; private static final TransportVersion VERSION_SUPPORTING_DENSE_VECTOR_STATS = TransportVersions.V_8_10_X; + private static final TransportVersion VERSION_SUPPORTING_SPARSE_VECTOR_STATS = TransportVersions.V_8_15_0; @Nullable public DocsStats docs; diff --git a/server/src/main/java/org/elasticsearch/action/bulk/BulkShardRequest.java b/server/src/main/java/org/elasticsearch/action/bulk/BulkShardRequest.java index 8d8f60cc3ba7b..406ba9723b427 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/BulkShardRequest.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/BulkShardRequest.java @@ -43,7 +43,7 @@ public final class BulkShardRequest extends ReplicatedWriteRequest i.readOptionalWriteable(inpt -> new BulkItemRequest(shardId, inpt)), BulkItemRequest[]::new); - if (in.getTransportVersion().onOrAfter(TransportVersions.SIMULATE_VALIDATES_MAPPINGS)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { isSimulated = in.readBoolean(); } else { isSimulated = false; @@ -132,7 +132,7 @@ public void writeTo(StreamOutput out) throws IOException { } super.writeTo(out); out.writeArray((o, item) -> o.writeOptional(BulkItemRequest.THIN_WRITER, item), items); - if (out.getTransportVersion().onOrAfter(TransportVersions.SIMULATE_VALIDATES_MAPPINGS)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeBoolean(isSimulated); } } diff --git a/server/src/main/java/org/elasticsearch/action/datastreams/lifecycle/ExplainIndexDataStreamLifecycle.java b/server/src/main/java/org/elasticsearch/action/datastreams/lifecycle/ExplainIndexDataStreamLifecycle.java index 94c294435acd3..f9bd135968246 100644 --- a/server/src/main/java/org/elasticsearch/action/datastreams/lifecycle/ExplainIndexDataStreamLifecycle.java +++ b/server/src/main/java/org/elasticsearch/action/datastreams/lifecycle/ExplainIndexDataStreamLifecycle.java @@ -82,7 +82,7 @@ public ExplainIndexDataStreamLifecycle( public ExplainIndexDataStreamLifecycle(StreamInput in) throws IOException { this.index = in.readString(); this.managedByLifecycle = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersions.NO_GLOBAL_RETENTION_FOR_SYSTEM_DATA_STREAMS)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { this.isInternalDataStream = in.readBoolean(); } else { this.isInternalDataStream = false; @@ -165,7 +165,7 @@ public XContentBuilder toXContent( public void writeTo(StreamOutput out) throws IOException { out.writeString(index); out.writeBoolean(managedByLifecycle); - if (out.getTransportVersion().onOrAfter(TransportVersions.NO_GLOBAL_RETENTION_FOR_SYSTEM_DATA_STREAMS)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeBoolean(isInternalDataStream); } if (managedByLifecycle) { diff --git a/server/src/main/java/org/elasticsearch/action/datastreams/lifecycle/GetDataStreamLifecycleAction.java b/server/src/main/java/org/elasticsearch/action/datastreams/lifecycle/GetDataStreamLifecycleAction.java index bd628c88a1b1e..a43d29501a7ee 100644 --- a/server/src/main/java/org/elasticsearch/action/datastreams/lifecycle/GetDataStreamLifecycleAction.java +++ b/server/src/main/java/org/elasticsearch/action/datastreams/lifecycle/GetDataStreamLifecycleAction.java @@ -173,7 +173,7 @@ public record DataStreamLifecycle( this( in.readString(), in.readOptionalWriteable(org.elasticsearch.cluster.metadata.DataStreamLifecycle::new), - in.getTransportVersion().onOrAfter(TransportVersions.NO_GLOBAL_RETENTION_FOR_SYSTEM_DATA_STREAMS) && in.readBoolean() + in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0) && in.readBoolean() ); } @@ -181,7 +181,7 @@ public record DataStreamLifecycle( public void writeTo(StreamOutput out) throws IOException { out.writeString(dataStreamName); out.writeOptionalWriteable(lifecycle); - if (out.getTransportVersion().onOrAfter(TransportVersions.NO_GLOBAL_RETENTION_FOR_SYSTEM_DATA_STREAMS)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeBoolean(isInternalDataStream); } } diff --git a/server/src/main/java/org/elasticsearch/action/ingest/SimulateIndexResponse.java b/server/src/main/java/org/elasticsearch/action/ingest/SimulateIndexResponse.java index 1b930d5e8db3f..9d883cb075ede 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/SimulateIndexResponse.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/SimulateIndexResponse.java @@ -42,7 +42,7 @@ public SimulateIndexResponse(StreamInput in) throws IOException { this.source = in.readBytesReference(); this.sourceXContentType = XContentType.valueOf(in.readString()); setShardInfo(ShardInfo.EMPTY); - if (in.getTransportVersion().onOrAfter(TransportVersions.SIMULATE_VALIDATES_MAPPINGS)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { this.exception = in.readException(); } else { this.exception = null; @@ -102,7 +102,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeBytesReference(source); out.writeString(sourceXContentType.name()); - if (out.getTransportVersion().onOrAfter(TransportVersions.SIMULATE_VALIDATES_MAPPINGS)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeException(exception); } } diff --git a/server/src/main/java/org/elasticsearch/action/support/master/MasterNodeRequest.java b/server/src/main/java/org/elasticsearch/action/support/master/MasterNodeRequest.java index 2566e109b70e4..8d29025c1f0be 100644 --- a/server/src/main/java/org/elasticsearch/action/support/master/MasterNodeRequest.java +++ b/server/src/main/java/org/elasticsearch/action/support/master/MasterNodeRequest.java @@ -78,7 +78,7 @@ protected MasterNodeRequest(TimeValue masterNodeTimeout) { protected MasterNodeRequest(StreamInput in) throws IOException { super(in); masterNodeTimeout = in.readTimeValue(); - if (in.getTransportVersion().onOrAfter(TransportVersions.VERSIONED_MASTER_NODE_REQUESTS)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { masterTerm = in.readVLong(); } else { masterTerm = 0L; @@ -92,7 +92,7 @@ public void writeTo(StreamOutput out) throws IOException { assert masterTerm <= newMasterTerm : masterTerm + " vs " + newMasterTerm; super.writeTo(out); out.writeTimeValue(masterNodeTimeout); - if (out.getTransportVersion().onOrAfter(TransportVersions.VERSIONED_MASTER_NODE_REQUESTS)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeVLong(newMasterTerm); } // else no protection against routing loops in older versions } diff --git a/server/src/main/java/org/elasticsearch/cluster/ClusterState.java b/server/src/main/java/org/elasticsearch/cluster/ClusterState.java index 64df6e77326e4..f7cad013554c6 100644 --- a/server/src/main/java/org/elasticsearch/cluster/ClusterState.java +++ b/server/src/main/java/org/elasticsearch/cluster/ClusterState.java @@ -241,9 +241,7 @@ public ClusterState( } private boolean assertEventIngestedIsUnknownInMixedClusters(Metadata metadata, CompatibilityVersions compatibilityVersions) { - if (compatibilityVersions.transportVersion().before(TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE) - && metadata != null - && metadata.indices() != null) { + if (compatibilityVersions.transportVersion().before(TransportVersions.V_8_15_0) && metadata != null && metadata.indices() != null) { for (IndexMetadata indexMetadata : metadata.indices().values()) { assert indexMetadata.getEventIngestedRange() == IndexLongFieldRange.UNKNOWN : "event.ingested range should be UNKNOWN but is " diff --git a/server/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java b/server/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java index 4b84854315a82..bd438d66549aa 100644 --- a/server/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java +++ b/server/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java @@ -722,7 +722,7 @@ public ClusterState execute(BatchExecutionContext batchE */ IndexLongFieldRange newEventIngestedMillisRange = IndexLongFieldRange.UNKNOWN; TransportVersion minTransportVersion = batchExecutionContext.initialState().getMinTransportVersion(); - if (minTransportVersion.onOrAfter(TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE)) { + if (minTransportVersion.onOrAfter(TransportVersions.V_8_15_0)) { newEventIngestedMillisRange = currentEventIngestedMillisRange.extendWithShardRange( startedShardEntry.shardId.id(), indexMetadata.getNumberOfShards(), @@ -827,7 +827,7 @@ public static class StartedShardEntry extends TransportRequest { primaryTerm = in.readVLong(); this.message = in.readString(); this.timestampRange = ShardLongFieldRange.readFrom(in); - if (in.getTransportVersion().onOrAfter(TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { this.eventIngestedRange = ShardLongFieldRange.readFrom(in); } else { this.eventIngestedRange = ShardLongFieldRange.UNKNOWN; @@ -858,7 +858,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(primaryTerm); out.writeString(message); timestampRange.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { eventIngestedRange.writeTo(out); } } diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/JoinStatus.java b/server/src/main/java/org/elasticsearch/cluster/coordination/JoinStatus.java index 5182e01899c6c..89083848d488d 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/JoinStatus.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/JoinStatus.java @@ -25,7 +25,7 @@ public JoinStatus(StreamInput in) throws IOException { new DiscoveryNode(in), in.readLong(), in.readString(), - in.getTransportVersion().onOrAfter(TransportVersions.JOIN_STATUS_AGE_SERIALIZATION) + in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0) ? in.readTimeValue() : new TimeValue(in.readLong(), TimeUnit.valueOf(in.readString())) ); @@ -36,7 +36,7 @@ public void writeTo(StreamOutput out) throws IOException { remoteNode.writeTo(out); out.writeLong(term); out.writeString(message); - if (out.getTransportVersion().onOrAfter(TransportVersions.JOIN_STATUS_AGE_SERIALIZATION)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeTimeValue(age); } else { out.writeLong(age.duration()); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java index dd4a52fd9beda..bedf65e1a9c8b 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java @@ -211,7 +211,7 @@ public static DataStream read(StreamInput in) throws IOException { if (in.getTransportVersion().onOrAfter(DataStream.ADDED_AUTO_SHARDING_EVENT_VERSION)) { backingIndicesBuilder.setAutoShardingEvent(in.readOptionalWriteable(DataStreamAutoShardingEvent::new)); } - if (in.getTransportVersion().onOrAfter(TransportVersions.FAILURE_STORE_FIELD_PARITY)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { failureIndicesBuilder.setRolloverOnWrite(in.readBoolean()) .setAutoShardingEvent(in.readOptionalWriteable(DataStreamAutoShardingEvent::new)); } @@ -1089,7 +1089,7 @@ public void writeTo(StreamOutput out) throws IOException { if (out.getTransportVersion().onOrAfter(DataStream.ADDED_AUTO_SHARDING_EVENT_VERSION)) { out.writeOptionalWriteable(backingIndices.autoShardingEvent); } - if (out.getTransportVersion().onOrAfter(TransportVersions.FAILURE_STORE_FIELD_PARITY)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeBoolean(failureIndices.rolloverOnWrite); out.writeOptionalWriteable(failureIndices.autoShardingEvent); } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java index 23e8e49aa16db..6456240c2317e 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java @@ -41,6 +41,7 @@ import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.Nullable; +import org.elasticsearch.core.UpdateForV9; import org.elasticsearch.gateway.MetadataStateFormat; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexMode; @@ -945,9 +946,9 @@ public IndexMetadata withTimestampRanges( if (timestampRange.equals(this.timestampRange) && eventIngestedRange.equals(this.eventIngestedRange)) { return this; } + @UpdateForV9(owner = UpdateForV9.Owner.SEARCH_FOUNDATIONS) // remove this check when 8.15 is no longer communicable IndexLongFieldRange allowedEventIngestedRange = eventIngestedRange; - // remove this check when the EVENT_INGESTED_RANGE_IN_CLUSTER_STATE version is removed - if (minClusterTransportVersion.before(TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE)) { + if (minClusterTransportVersion.before(TransportVersions.V_8_15_0)) { allowedEventIngestedRange = IndexLongFieldRange.UNKNOWN; } return new IndexMetadata( @@ -1644,7 +1645,7 @@ private static class IndexMetadataDiff implements Diff { DiffableUtils.getStringKeySerializer(), ROLLOVER_INFO_DIFF_VALUE_READER ); - if (in.getTransportVersion().onOrAfter(TransportVersions.INDEX_METADATA_MAPPINGS_UPDATED_VERSION)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { mappingsUpdatedVersion = IndexVersion.readVersion(in); } else { mappingsUpdatedVersion = IndexVersions.ZERO; @@ -1664,7 +1665,7 @@ private static class IndexMetadataDiff implements Diff { indexWriteLoadForecast = null; shardSizeInBytesForecast = null; } - if (in.getTransportVersion().onOrAfter(TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { eventIngestedRange = IndexLongFieldRange.readFrom(in); } else { eventIngestedRange = IndexLongFieldRange.UNKNOWN; @@ -1698,7 +1699,7 @@ public void writeTo(StreamOutput out) throws IOException { customData.writeTo(out); inSyncAllocationIds.writeTo(out); rolloverInfos.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersions.INDEX_METADATA_MAPPINGS_UPDATED_VERSION)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { IndexVersion.writeVersion(mappingsUpdatedVersion, out); } if (out.getTransportVersion().onOrAfter(SYSTEM_INDEX_FLAG_ADDED)) { @@ -1710,7 +1711,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalDouble(indexWriteLoadForecast); out.writeOptionalLong(shardSizeInBytesForecast); } - if (out.getTransportVersion().onOrAfter(TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { eventIngestedRange.writeTo(out); } else { assert eventIngestedRange == IndexLongFieldRange.UNKNOWN @@ -1809,7 +1810,7 @@ public static IndexMetadata readFrom(StreamInput in, @Nullable Function DiffableUtils.StringSetValueSerializer.getInstance().write(v, o) ); out.writeCollection(rolloverInfos.values()); - if (out.getTransportVersion().onOrAfter(TransportVersions.INDEX_METADATA_MAPPINGS_UPDATED_VERSION)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { IndexVersion.writeVersion(mappingsUpdatedVersion, out); } if (out.getTransportVersion().onOrAfter(SYSTEM_INDEX_FLAG_ADDED)) { @@ -1879,7 +1880,7 @@ public void writeTo(StreamOutput out, boolean mappingsAsHash) throws IOException out.writeOptionalDouble(writeLoadForecast); out.writeOptionalLong(shardSizeInBytesForecast); } - if (out.getTransportVersion().onOrAfter(TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { eventIngestedRange.writeTo(out); } else { assert eventIngestedRange == IndexLongFieldRange.UNKNOWN @@ -2205,8 +2206,7 @@ public Builder eventIngestedRange(IndexLongFieldRange eventIngestedRange, Transp + minClusterTransportVersion + "; eventIngestedRange = " + eventIngestedRange; - if (minClusterTransportVersion != null - && minClusterTransportVersion.before(TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE)) { + if (minClusterTransportVersion != null && minClusterTransportVersion.before(TransportVersions.V_8_15_0)) { this.eventIngestedRange = IndexLongFieldRange.UNKNOWN; } else { this.eventIngestedRange = eventIngestedRange; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java index 29720e98a6e7b..321719475c1f8 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java @@ -1306,7 +1306,7 @@ static IndexMetadata buildIndexMetadata( ) { IndexMetadata.Builder indexMetadataBuilder = createIndexMetadataBuilder(indexName, sourceMetadata, indexSettings, routingNumShards); indexMetadataBuilder.system(isSystem); - if (minClusterTransportVersion.before(TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE)) { + if (minClusterTransportVersion.before(TransportVersions.V_8_15_0)) { // promote to UNKNOWN for older versions since they don't know how to handle event.ingested in cluster state indexMetadataBuilder.eventIngestedRange(IndexLongFieldRange.UNKNOWN, minClusterTransportVersion); } diff --git a/server/src/main/java/org/elasticsearch/index/stats/IndexingPressureStats.java b/server/src/main/java/org/elasticsearch/index/stats/IndexingPressureStats.java index c755862d9e828..b5197274dd519 100644 --- a/server/src/main/java/org/elasticsearch/index/stats/IndexingPressureStats.java +++ b/server/src/main/java/org/elasticsearch/index/stats/IndexingPressureStats.java @@ -80,7 +80,7 @@ public IndexingPressureStats(StreamInput in) throws IOException { primaryDocumentRejections = -1L; } - if (in.getTransportVersion().onOrAfter(TransportVersions.INDEXING_PRESSURE_REQUEST_REJECTIONS_COUNT)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { totalCoordinatingRequests = in.readVLong(); } else { totalCoordinatingRequests = -1L; @@ -157,7 +157,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(primaryDocumentRejections); } - if (out.getTransportVersion().onOrAfter(TransportVersions.INDEXING_PRESSURE_REQUEST_REJECTIONS_COUNT)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeVLong(totalCoordinatingRequests); } } diff --git a/server/src/main/java/org/elasticsearch/ingest/IngestStats.java b/server/src/main/java/org/elasticsearch/ingest/IngestStats.java index a7f0a16b9025d..39df4e53423a2 100644 --- a/server/src/main/java/org/elasticsearch/ingest/IngestStats.java +++ b/server/src/main/java/org/elasticsearch/ingest/IngestStats.java @@ -65,9 +65,7 @@ public static IngestStats read(StreamInput in) throws IOException { for (var i = 0; i < size; i++) { var pipelineId = in.readString(); var pipelineStat = new Stats(in); - var byteStat = in.getTransportVersion().onOrAfter(TransportVersions.NODE_STATS_INGEST_BYTES) - ? new ByteStats(in) - : new ByteStats(0, 0); + var byteStat = in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0) ? new ByteStats(in) : new ByteStats(0, 0); pipelineStats.add(new PipelineStat(pipelineId, pipelineStat, byteStat)); int processorsSize = in.readVInt(); var processorStatsPerPipeline = new ArrayList(processorsSize); @@ -90,7 +88,7 @@ public void writeTo(StreamOutput out) throws IOException { for (PipelineStat pipelineStat : pipelineStats) { out.writeString(pipelineStat.pipelineId()); pipelineStat.stats().writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersions.NODE_STATS_INGEST_BYTES)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { pipelineStat.byteStats().writeTo(out); } List processorStatsForPipeline = processorStats.get(pipelineStat.pipelineId()); diff --git a/server/src/main/java/org/elasticsearch/search/builder/PointInTimeBuilder.java b/server/src/main/java/org/elasticsearch/search/builder/PointInTimeBuilder.java index 0d11ce15b6878..eecc840e8602c 100644 --- a/server/src/main/java/org/elasticsearch/search/builder/PointInTimeBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/builder/PointInTimeBuilder.java @@ -63,7 +63,7 @@ public PointInTimeBuilder(BytesReference pitID) { } public PointInTimeBuilder(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersions.BINARY_PIT_ID)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { encodedId = in.readBytesReference(); } else { encodedId = new BytesArray(Base64.getUrlDecoder().decode(in.readString())); @@ -73,7 +73,7 @@ public PointInTimeBuilder(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersions.BINARY_PIT_ID)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeBytesReference(encodedId); } else { out.writeString(Base64.getUrlEncoder().encodeToString(BytesReference.toBytes(encodedId))); diff --git a/server/src/main/java/org/elasticsearch/search/fetch/ShardFetchSearchRequest.java b/server/src/main/java/org/elasticsearch/search/fetch/ShardFetchSearchRequest.java index efde60f4a0d29..534c764c07b7b 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/ShardFetchSearchRequest.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/ShardFetchSearchRequest.java @@ -61,7 +61,7 @@ public ShardFetchSearchRequest(StreamInput in) throws IOException { shardSearchRequest = in.readOptionalWriteable(ShardSearchRequest::new); rescoreDocIds = new RescoreDocIds(in); aggregatedDfs = in.readOptionalWriteable(AggregatedDfs::new); - if (in.getTransportVersion().onOrAfter(TransportVersions.RANK_DOC_IN_SHARD_FETCH_REQUEST)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { this.rankDocs = in.readOptionalWriteable(RankDocShardInfo::new); } else { this.rankDocs = null; @@ -75,7 +75,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(shardSearchRequest); rescoreDocIds.writeTo(out); out.writeOptionalWriteable(aggregatedDfs); - if (out.getTransportVersion().onOrAfter(TransportVersions.RANK_DOC_IN_SHARD_FETCH_REQUEST)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeOptionalWriteable(rankDocs); } } diff --git a/server/src/main/java/org/elasticsearch/search/rank/feature/RankFeatureShardResult.java b/server/src/main/java/org/elasticsearch/search/rank/feature/RankFeatureShardResult.java index eb8d03bd1406f..13cf9f339d7d4 100644 --- a/server/src/main/java/org/elasticsearch/search/rank/feature/RankFeatureShardResult.java +++ b/server/src/main/java/org/elasticsearch/search/rank/feature/RankFeatureShardResult.java @@ -43,7 +43,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.RANK_FEATURE_PHASE_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/server/src/main/java/org/elasticsearch/search/vectors/ExactKnnQueryBuilder.java b/server/src/main/java/org/elasticsearch/search/vectors/ExactKnnQueryBuilder.java index 30a32e9a615de..c8670a8dfeec2 100644 --- a/server/src/main/java/org/elasticsearch/search/vectors/ExactKnnQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/vectors/ExactKnnQueryBuilder.java @@ -56,7 +56,7 @@ public ExactKnnQueryBuilder(StreamInput in) throws IOException { } this.field = in.readString(); if (in.getTransportVersion().onOrAfter(TransportVersions.FIX_VECTOR_SIMILARITY_INNER_HITS) - || in.getTransportVersion().isPatchFrom(TransportVersions.FIX_VECTOR_SIMILARITY_INNER_HITS_BACKPORT_8_15)) { + || in.getTransportVersion().isPatchFrom(TransportVersions.V_8_15_0)) { this.vectorSimilarity = in.readOptionalFloat(); } else { this.vectorSimilarity = null; @@ -89,7 +89,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { } out.writeString(field); if (out.getTransportVersion().onOrAfter(TransportVersions.FIX_VECTOR_SIMILARITY_INNER_HITS) - || out.getTransportVersion().isPatchFrom(TransportVersions.FIX_VECTOR_SIMILARITY_INNER_HITS_BACKPORT_8_15)) { + || out.getTransportVersion().isPatchFrom(TransportVersions.V_8_15_0)) { out.writeOptionalFloat(vectorSimilarity); } } diff --git a/server/src/main/java/org/elasticsearch/search/vectors/KnnScoreDocQueryBuilder.java b/server/src/main/java/org/elasticsearch/search/vectors/KnnScoreDocQueryBuilder.java index 15052fdad3818..f52addefc8b1c 100644 --- a/server/src/main/java/org/elasticsearch/search/vectors/KnnScoreDocQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/vectors/KnnScoreDocQueryBuilder.java @@ -72,7 +72,7 @@ public KnnScoreDocQueryBuilder(StreamInput in) throws IOException { this.queryVector = null; } if (in.getTransportVersion().onOrAfter(TransportVersions.FIX_VECTOR_SIMILARITY_INNER_HITS) - || in.getTransportVersion().isPatchFrom(TransportVersions.FIX_VECTOR_SIMILARITY_INNER_HITS_BACKPORT_8_15)) { + || in.getTransportVersion().isPatchFrom(TransportVersions.V_8_15_0)) { this.vectorSimilarity = in.readOptionalFloat(); } else { this.vectorSimilarity = null; @@ -117,7 +117,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { } } if (out.getTransportVersion().onOrAfter(TransportVersions.FIX_VECTOR_SIMILARITY_INNER_HITS) - || out.getTransportVersion().isPatchFrom(TransportVersions.FIX_VECTOR_SIMILARITY_INNER_HITS_BACKPORT_8_15)) { + || out.getTransportVersion().isPatchFrom(TransportVersions.V_8_15_0)) { out.writeOptionalFloat(vectorSimilarity); } } diff --git a/server/src/main/java/org/elasticsearch/search/vectors/KnnSearchBuilder.java b/server/src/main/java/org/elasticsearch/search/vectors/KnnSearchBuilder.java index a30aa0efc8bb3..8ce8fc07f3acd 100644 --- a/server/src/main/java/org/elasticsearch/search/vectors/KnnSearchBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/vectors/KnnSearchBuilder.java @@ -261,7 +261,7 @@ public KnnSearchBuilder(StreamInput in) throws IOException { } this.filterQueries = in.readNamedWriteableCollectionAsList(QueryBuilder.class); this.boost = in.readFloat(); - if (in.getTransportVersion().onOrAfter(TransportVersions.TOP_LEVEL_KNN_SUPPORT_QUERY_NAME)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { this.queryName = in.readOptionalString(); } else { this.queryName = null; @@ -501,7 +501,7 @@ public void writeTo(StreamOutput out) throws IOException { } out.writeNamedWriteableCollection(filterQueries); out.writeFloat(boost); - if (out.getTransportVersion().onOrAfter(TransportVersions.TOP_LEVEL_KNN_SUPPORT_QUERY_NAME)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeOptionalString(queryName); } if (out.getTransportVersion().before(TransportVersions.V_8_7_0) && queryVectorBuilder != null) { diff --git a/server/src/main/java/org/elasticsearch/search/vectors/KnnVectorQueryBuilder.java b/server/src/main/java/org/elasticsearch/search/vectors/KnnVectorQueryBuilder.java index 9af1968b55d14..deb7e6bd035b8 100644 --- a/server/src/main/java/org/elasticsearch/search/vectors/KnnVectorQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/vectors/KnnVectorQueryBuilder.java @@ -192,7 +192,7 @@ private KnnVectorQueryBuilder( public KnnVectorQueryBuilder(StreamInput in) throws IOException { super(in); this.fieldName = in.readString(); - if (in.getTransportVersion().onOrAfter(TransportVersions.K_FOR_KNN_QUERY_ADDED)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { this.k = in.readOptionalVInt(); } else { this.k = null; @@ -279,7 +279,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { throw new IllegalStateException("missing a rewriteAndFetch?"); } out.writeString(fieldName); - if (out.getTransportVersion().onOrAfter(TransportVersions.K_FOR_KNN_QUERY_ADDED)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeOptionalVInt(k); } if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_13_0)) { diff --git a/server/src/test/java/org/elasticsearch/TransportVersionTests.java b/server/src/test/java/org/elasticsearch/TransportVersionTests.java index e3ab7463ad941..6c2cc5c1f4cc0 100644 --- a/server/src/test/java/org/elasticsearch/TransportVersionTests.java +++ b/server/src/test/java/org/elasticsearch/TransportVersionTests.java @@ -211,7 +211,7 @@ public void testDenseTransportVersions() { Set missingVersions = new TreeSet<>(); TransportVersion previous = null; for (var tv : TransportVersions.getAllVersions()) { - if (tv.before(TransportVersions.V_8_14_0)) { + if (tv.before(TransportVersions.V_8_15_2)) { continue; } if (previous == null) { diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsRequestParametersTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsRequestParametersTests.java index e7661bf3848f5..f37b1d1b41712 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsRequestParametersTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsRequestParametersTests.java @@ -23,7 +23,7 @@ public class NodesStatsRequestParametersTests extends ESTestCase { public void testReadWriteMetricSet() { - for (var version : List.of(TransportVersions.VERSIONED_MASTER_NODE_REQUESTS, TransportVersions.NODES_STATS_ENUM_SET)) { + for (var version : List.of(TransportVersions.V_8_15_0, TransportVersions.NODES_STATS_ENUM_SET)) { var randSet = randomSubsetOf(Metric.ALL); var metricsOut = randSet.isEmpty() ? EnumSet.noneOf(Metric.class) : EnumSet.copyOf(randSet); try { diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequestTests.java index 733ef1c2d5935..9957acee36b9d 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequestTests.java @@ -50,7 +50,7 @@ public void testBwcSerialization() throws Exception { in.setTransportVersion(out.getTransportVersion()); assertEquals(request.getParentTask(), TaskId.readFromStream(in)); assertEquals(request.masterNodeTimeout(), in.readTimeValue()); - if (in.getTransportVersion().onOrAfter(TransportVersions.VERSIONED_MASTER_NODE_REQUESTS)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { assertEquals(request.masterTerm(), in.readVLong()); } assertEquals(request.ackTimeout(), in.readTimeValue()); @@ -79,7 +79,7 @@ public void testBwcSerialization() throws Exception { out.setTransportVersion(version); sample.getParentTask().writeTo(out); out.writeTimeValue(sample.masterNodeTimeout()); - if (out.getTransportVersion().onOrAfter(TransportVersions.VERSIONED_MASTER_NODE_REQUESTS)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeVLong(sample.masterTerm()); } out.writeTimeValue(sample.ackTimeout()); diff --git a/server/src/test/java/org/elasticsearch/cluster/action/shard/ShardStartedClusterStateTaskExecutorTests.java b/server/src/test/java/org/elasticsearch/cluster/action/shard/ShardStartedClusterStateTaskExecutorTests.java index d1734dbf45f04..ca7376a43d718 100644 --- a/server/src/test/java/org/elasticsearch/cluster/action/shard/ShardStartedClusterStateTaskExecutorTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/action/shard/ShardStartedClusterStateTaskExecutorTests.java @@ -424,7 +424,7 @@ public void testExpandsTimestampRangeForPrimary() throws Exception { } final var eventIngestedRange = resultingState.metadata().index(indexName).getEventIngestedRange(); - if (clusterState.getMinTransportVersion().before(TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE)) { + if (clusterState.getMinTransportVersion().before(TransportVersions.V_8_15_0)) { assertThat(eventIngestedRange, sameInstance(IndexLongFieldRange.UNKNOWN)); } else { if (shardEventIngestedRange == ShardLongFieldRange.UNKNOWN) { diff --git a/server/src/test/java/org/elasticsearch/cluster/action/shard/ShardStateActionTests.java b/server/src/test/java/org/elasticsearch/cluster/action/shard/ShardStateActionTests.java index a1536e17a15de..3c680d891ff13 100644 --- a/server/src/test/java/org/elasticsearch/cluster/action/shard/ShardStateActionTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/action/shard/ShardStateActionTests.java @@ -599,7 +599,7 @@ public void testStartedShardEntrySerialization() throws Exception { assertThat(deserialized.primaryTerm, equalTo(primaryTerm)); assertThat(deserialized.message, equalTo(message)); assertThat(deserialized.timestampRange, equalTo(timestampRange)); - if (version.before(TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE)) { + if (version.before(TransportVersions.V_8_15_0)) { assertThat(deserialized.eventIngestedRange, equalTo(ShardLongFieldRange.UNKNOWN)); } else { assertThat(deserialized.eventIngestedRange, equalTo(eventIngestedRange)); @@ -615,7 +615,7 @@ public void testStartedShardEntrySerializationWithOlderTransportVersion() throws final TransportVersion version = randomFrom( getFirstVersion(), getPreviousVersion(TransportVersions.MINIMUM_COMPATIBLE), - getPreviousVersion(TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE) + getPreviousVersion(TransportVersions.V_8_15_0) ); final ShardLongFieldRange timestampRange = ShardLongFieldRangeWireTests.randomRange(); final ShardLongFieldRange eventIngestedRange = ShardLongFieldRangeWireTests.randomRange(); diff --git a/server/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java b/server/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java index ca5b9295adfd7..d8f3c4f1af48e 100644 --- a/server/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java @@ -70,7 +70,7 @@ public void testClusterStateSerialization() throws Exception { .settings(settings(IndexVersion.current())) .numberOfShards(10) .numberOfReplicas(1) - .eventIngestedRange(eventIngestedRangeInput, TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE); + .eventIngestedRange(eventIngestedRangeInput, TransportVersions.V_8_15_0); ClusterStateTestRecord result = createAndSerializeClusterState(indexMetadataBuilder, TransportVersion.current()); @@ -90,7 +90,7 @@ public void testClusterStateSerializationWithTimestampRangesWithOlderTransportVe TransportVersion versionBeforeEventIngestedInClusterState = randomFrom( TransportVersions.V_7_0_0, TransportVersions.V_8_0_0, - TransportVersions.ML_INFERENCE_GOOGLE_VERTEX_AI_EMBEDDINGS_ADDED // version before EVENT_INGESTED_RANGE_IN_CLUSTER_STATE + TransportVersionUtils.getPreviousVersion(TransportVersions.V_8_15_0) ); { IndexLongFieldRange eventIngestedRangeInput = randomFrom( diff --git a/server/src/test/java/org/elasticsearch/search/rank/RankFeatureShardPhaseTests.java b/server/src/test/java/org/elasticsearch/search/rank/RankFeatureShardPhaseTests.java index 5862e1bd1329f..6250d1679fda3 100644 --- a/server/src/test/java/org/elasticsearch/search/rank/RankFeatureShardPhaseTests.java +++ b/server/src/test/java/org/elasticsearch/search/rank/RankFeatureShardPhaseTests.java @@ -196,7 +196,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.RANK_FEATURE_PHASE_ADDED; + return TransportVersions.V_8_15_0; } }; } diff --git a/test/framework/src/main/java/org/elasticsearch/action/support/replication/ClusterStateCreationUtils.java b/test/framework/src/main/java/org/elasticsearch/action/support/replication/ClusterStateCreationUtils.java index 6a0b4f2dd2c1b..a11291e846ec1 100644 --- a/test/framework/src/main/java/org/elasticsearch/action/support/replication/ClusterStateCreationUtils.java +++ b/test/framework/src/main/java/org/elasticsearch/action/support/replication/ClusterStateCreationUtils.java @@ -151,10 +151,7 @@ public static ClusterState state( .settings(indexSettings(IndexVersion.current(), 1, numberOfReplicas).put(SETTING_CREATION_DATE, System.currentTimeMillis())) .primaryTerm(0, primaryTerm) .timestampRange(timeFieldRange) - .eventIngestedRange( - timeFieldRange, - timeFieldRange == IndexLongFieldRange.UNKNOWN ? null : TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE - ) + .eventIngestedRange(timeFieldRange, timeFieldRange == IndexLongFieldRange.UNKNOWN ? null : TransportVersions.V_8_15_0) .build(); IndexShardRoutingTable.Builder indexShardRoutingBuilder = new IndexShardRoutingTable.Builder(shardId); @@ -287,10 +284,7 @@ public static ClusterState state(final int numberOfNodes, final String[] indices .settings( indexSettings(IndexVersion.current(), numberOfPrimaries, 0).put(SETTING_CREATION_DATE, System.currentTimeMillis()) ) - .eventIngestedRange( - IndexLongFieldRange.UNKNOWN, - randomFrom(TransportVersions.V_8_0_0, TransportVersions.EVENT_INGESTED_RANGE_IN_CLUSTER_STATE) - ) + .eventIngestedRange(IndexLongFieldRange.UNKNOWN, randomFrom(TransportVersions.V_8_0_0, TransportVersions.V_8_15_0)) .build(); IndexRoutingTable.Builder indexRoutingTable = IndexRoutingTable.builder(indexMetadata.getIndex()); diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingCapacityAction.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingCapacityAction.java index 81b53487f9f15..836c8b155cb09 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingCapacityAction.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingCapacityAction.java @@ -47,7 +47,7 @@ public Request(TimeValue masterNodeTimeout) { public Request(final StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().before(TransportVersions.GET_AUTOSCALING_CAPACITY_UNUSED_TIMEOUT)) { + if (in.getTransportVersion().before(TransportVersions.V_8_15_0)) { in.readTimeValue(); // unused } } @@ -55,7 +55,7 @@ public Request(final StreamInput in) throws IOException { @Override public void writeTo(final StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().before(TransportVersions.GET_AUTOSCALING_CAPACITY_UNUSED_TIMEOUT)) { + if (out.getTransportVersion().before(TransportVersions.V_8_15_0)) { out.writeTimeValue(AcknowledgedRequest.DEFAULT_ACK_TIMEOUT); // unused } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamFeatureSetUsage.java index 63fcd3dc4e798..e267c94e06892 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamFeatureSetUsage.java @@ -91,8 +91,8 @@ public DataStreamStats(StreamInput in) throws IOException { this( in.readVLong(), in.readVLong(), - in.getTransportVersion().onOrAfter(TransportVersions.FAILURE_STORE_TELEMETRY) ? in.readVLong() : 0, - in.getTransportVersion().onOrAfter(TransportVersions.FAILURE_STORE_TELEMETRY) ? in.readVLong() : 0 + in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0) ? in.readVLong() : 0, + in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0) ? in.readVLong() : 0 ); } @@ -100,7 +100,7 @@ public DataStreamStats(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { out.writeVLong(this.totalDataStreamCount); out.writeVLong(this.indicesBehindDataStream); - if (out.getTransportVersion().onOrAfter(TransportVersions.FAILURE_STORE_TELEMETRY)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeVLong(this.failureStoreEnabledDataStreamCount); out.writeVLong(this.failureStoreIndicesCount); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/EnrichStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/EnrichStatsAction.java index fc9087d97bd79..0457de6edcc9f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/EnrichStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/EnrichStatsAction.java @@ -207,8 +207,8 @@ public CacheStats(StreamInput in) throws IOException { in.readVLong(), in.readVLong(), in.readVLong(), - in.getTransportVersion().onOrAfter(TransportVersions.ENRICH_CACHE_ADDITIONAL_STATS) ? in.readLong() : -1, - in.getTransportVersion().onOrAfter(TransportVersions.ENRICH_CACHE_ADDITIONAL_STATS) ? in.readLong() : -1, + in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0) ? in.readLong() : -1, + in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0) ? in.readLong() : -1, in.getTransportVersion().onOrAfter(TransportVersions.ENRICH_CACHE_STATS_SIZE_ADDED) ? in.readLong() : -1 ); } @@ -233,7 +233,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(hits); out.writeVLong(misses); out.writeVLong(evictions); - if (out.getTransportVersion().onOrAfter(TransportVersions.ENRICH_CACHE_ADDITIONAL_STATS)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeLong(hitsTimeInMillis); out.writeLong(missesTimeInMillis); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/action/DeleteInferenceEndpointAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/action/DeleteInferenceEndpointAction.java index e9d612751e48f..226fe3630b387 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/action/DeleteInferenceEndpointAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/action/DeleteInferenceEndpointAction.java @@ -50,7 +50,7 @@ public Request(StreamInput in) throws IOException { super(in); this.inferenceEndpointId = in.readString(); this.taskType = TaskType.fromStream(in); - if (in.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_ENHANCE_DELETE_ENDPOINT)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { this.forceDelete = Boolean.TRUE.equals(in.readOptionalBoolean()); this.dryRun = Boolean.TRUE.equals(in.readOptionalBoolean()); } else { @@ -80,7 +80,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeString(inferenceEndpointId); taskType.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_ENHANCE_DELETE_ENDPOINT)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeOptionalBoolean(forceDelete); out.writeOptionalBoolean(dryRun); } @@ -121,7 +121,7 @@ public Response(boolean acknowledged, Set pipelineIds, Set seman public Response(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_ENHANCE_DELETE_ENDPOINT)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { pipelineIds = in.readCollectionAsSet(StreamInput::readString); } else { pipelineIds = Set.of(); @@ -140,7 +140,7 @@ public Response(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_ENHANCE_DELETE_ENDPOINT)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeCollection(pipelineIds, StreamOutput::writeString); } if (out.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_DONT_DELETE_WHEN_SEMANTIC_TEXT_EXISTS)) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/results/RankedDocsResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/results/RankedDocsResults.java index 6ebf15bf34937..e331cdbc59358 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/results/RankedDocsResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/results/RankedDocsResults.java @@ -31,8 +31,6 @@ import java.util.Objects; import java.util.stream.Collectors; -import static org.elasticsearch.TransportVersions.ML_RERANK_DOC_OPTIONAL; - public class RankedDocsResults implements InferenceServiceResults { public static final String NAME = "rerank_service_results"; public static final String RERANK = TaskType.RERANK.toString(); @@ -114,7 +112,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } public static RankedDoc of(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(ML_RERANK_DOC_OPTIONAL)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { return new RankedDoc(in.readInt(), in.readFloat(), in.readOptionalString()); } else if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_14_0)) { return new RankedDoc(in.readInt(), in.readFloat(), in.readString()); @@ -125,7 +123,7 @@ public static RankedDoc of(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(ML_RERANK_DOC_OPTIONAL)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeInt(index); out.writeFloat(relevanceScore); out.writeOptionalString(text); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferModelAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferModelAction.java index e6b580f62fdd3..05d9496e434c3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferModelAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferModelAction.java @@ -198,7 +198,7 @@ public Request(StreamInput in) throws IOException { } else { prefixType = TrainedModelPrefixStrings.PrefixType.NONE; } - if (in.getTransportVersion().onOrAfter(TransportVersions.ML_CHUNK_INFERENCE_OPTION)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { chunked = in.readBoolean(); } else { chunked = false; @@ -285,7 +285,7 @@ public void writeTo(StreamOutput out) throws IOException { if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_12_0)) { out.writeEnum(prefixType); } - if (out.getTransportVersion().onOrAfter(TransportVersions.ML_CHUNK_INFERENCE_OPTION)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeBoolean(chunked); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelCacheMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelCacheMetadata.java index 35c6bf96a09e1..3c8dfecc32e2a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelCacheMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelCacheMetadata.java @@ -86,7 +86,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_TRAINED_MODEL_CACHE_METADATA_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStats.java index a95ee13f57913..3a9123445e697 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStats.java @@ -264,7 +264,7 @@ public ModelSizeStats(StreamInput in) throws IOException { } else { assignmentMemoryBasis = null; } - if (in.getTransportVersion().onOrAfter(TransportVersions.ML_AD_OUTPUT_MEMORY_ALLOCATOR_FIELD)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { outputMemoryAllocatorBytes = in.readOptionalVLong(); } else { outputMemoryAllocatorBytes = null; @@ -306,7 +306,7 @@ public void writeTo(StreamOutput out) throws IOException { } else { out.writeBoolean(false); } - if (out.getTransportVersion().onOrAfter(TransportVersions.ML_AD_OUTPUT_MEMORY_ALLOCATOR_FIELD)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeOptionalVLong(outputMemoryAllocatorBytes); } out.writeVLong(categorizedDocCount); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupFeatureSetUsage.java index a198c0570cd91..6b4ee3c1fdd16 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupFeatureSetUsage.java @@ -16,15 +16,13 @@ import java.io.IOException; -import static org.elasticsearch.TransportVersions.ROLLUP_USAGE; - public class RollupFeatureSetUsage extends XPackFeatureSet.Usage { private final int numberOfRollupJobs; public RollupFeatureSetUsage(StreamInput input) throws IOException { super(input); - this.numberOfRollupJobs = input.getTransportVersion().onOrAfter(ROLLUP_USAGE) ? input.readVInt() : 0; + this.numberOfRollupJobs = input.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0) ? input.readVInt() : 0; } public RollupFeatureSetUsage(int numberOfRollupJobs) { @@ -39,7 +37,7 @@ public int getNumberOfRollupJobs() { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().onOrAfter(ROLLUP_USAGE)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeVInt(numberOfRollupJobs); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/GetSecuritySettingsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/GetSecuritySettingsAction.java index 093dfabd0bf65..88bc8a46532b5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/GetSecuritySettingsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/GetSecuritySettingsAction.java @@ -42,7 +42,7 @@ public Request(TimeValue masterNodeTimeout) { @UpdateForV9(owner = UpdateForV9.Owner.SECURITY) // no need for bwc any more, this can be inlined public static Request readFrom(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersions.SECURITY_SETTINGS_REQUEST_TIMEOUTS)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { return new Request(in); } else { return new Request(TimeValue.THIRTY_SECONDS); @@ -55,7 +55,7 @@ private Request(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersions.SECURITY_SETTINGS_REQUEST_TIMEOUTS)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { super.writeTo(out); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/UpdateSecuritySettingsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/UpdateSecuritySettingsAction.java index 316f162729356..c3bd1c51d113c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/UpdateSecuritySettingsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/UpdateSecuritySettingsAction.java @@ -118,7 +118,7 @@ public Request( @UpdateForV9(owner = UpdateForV9.Owner.SECURITY) // no need for bwc any more, this can be inlined public static Request readFrom(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersions.SECURITY_SETTINGS_REQUEST_TIMEOUTS)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { return new Request(in); } else { return new Request(TimeValue.THIRTY_SECONDS, TimeValue.THIRTY_SECONDS, in); @@ -141,7 +141,7 @@ private Request(TimeValue masterNodeTimeout, TimeValue ackTimeout, StreamInput i @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersions.SECURITY_SETTINGS_REQUEST_TIMEOUTS)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { super.writeTo(out); } out.writeGenericMap(this.mainIndexSettings); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponse.java index c5cbe50ef1575..de351cd59c690 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponse.java @@ -30,6 +30,8 @@ import java.util.TreeSet; import java.util.stream.Collectors; +import static org.elasticsearch.xpack.core.security.authz.permission.RemoteClusterPermissions.ROLE_REMOTE_CLUSTER_PRIVS; + /** * Response for a {@link GetUserPrivilegesRequest} */ @@ -55,7 +57,7 @@ public GetUserPrivilegesResponse(StreamInput in) throws IOException { } else { remoteIndex = Set.of(); } - if (in.getTransportVersion().onOrAfter(TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS)) { + if (in.getTransportVersion().onOrAfter(ROLE_REMOTE_CLUSTER_PRIVS)) { remoteClusterPermissions = new RemoteClusterPermissions(in); } else { remoteClusterPermissions = RemoteClusterPermissions.NONE; @@ -134,14 +136,14 @@ public void writeTo(StreamOutput out) throws IOException { + "]" ); } - if (out.getTransportVersion().onOrAfter(TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS)) { + if (out.getTransportVersion().onOrAfter(ROLE_REMOTE_CLUSTER_PRIVS)) { remoteClusterPermissions.writeTo(out); } else if (hasRemoteClusterPrivileges()) { throw new IllegalArgumentException( "versions of Elasticsearch before [" - + TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS + + ROLE_REMOTE_CLUSTER_PRIVS.toReleaseVersion() + "] can't handle remote cluster privileges and attempted to send to [" - + out.getTransportVersion() + + out.getTransportVersion().toReleaseVersion() + "]" ); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java index 3e3b1178b372c..04dda75692208 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java @@ -54,7 +54,6 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; -import static org.elasticsearch.TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS; import static org.elasticsearch.transport.RemoteClusterPortSettings.TRANSPORT_VERSION_ADVANCED_REMOTE_CLUSTER_SECURITY; import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; @@ -77,6 +76,7 @@ import static org.elasticsearch.xpack.core.security.authc.AuthenticationField.FALLBACK_REALM_NAME; import static org.elasticsearch.xpack.core.security.authc.AuthenticationField.FALLBACK_REALM_TYPE; import static org.elasticsearch.xpack.core.security.authc.RealmDomain.REALM_DOMAIN_PARSER; +import static org.elasticsearch.xpack.core.security.authz.permission.RemoteClusterPermissions.ROLE_REMOTE_CLUSTER_PRIVS; /** * The Authentication class encapsulates identity information created after successful authentication diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java index 1a8839fa0fa4a..8d069caf0496f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java @@ -50,6 +50,7 @@ import java.util.Objects; import static org.elasticsearch.common.xcontent.XContentHelper.createParserNotCompressed; +import static org.elasticsearch.xpack.core.security.authz.permission.RemoteClusterPermissions.ROLE_REMOTE_CLUSTER_PRIVS; /** * A holder for a Role that contains user-readable information about the Role @@ -58,6 +59,7 @@ public class RoleDescriptor implements ToXContentObject, Writeable { public static final TransportVersion WORKFLOWS_RESTRICTION_VERSION = TransportVersions.V_8_9_X; + public static final TransportVersion SECURITY_ROLE_DESCRIPTION = TransportVersions.V_8_15_0; public static final String ROLE_TYPE = "role"; @@ -220,12 +222,12 @@ public RoleDescriptor(StreamInput in) throws IOException { } else { this.restriction = Restriction.NONE; } - if (in.getTransportVersion().onOrAfter(TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS)) { + if (in.getTransportVersion().onOrAfter(ROLE_REMOTE_CLUSTER_PRIVS)) { this.remoteClusterPermissions = new RemoteClusterPermissions(in); } else { this.remoteClusterPermissions = RemoteClusterPermissions.NONE; } - if (in.getTransportVersion().onOrAfter(TransportVersions.SECURITY_ROLE_DESCRIPTION)) { + if (in.getTransportVersion().onOrAfter(SECURITY_ROLE_DESCRIPTION)) { this.description = in.readOptionalString(); } else { this.description = ""; @@ -485,10 +487,10 @@ public void writeTo(StreamOutput out) throws IOException { if (out.getTransportVersion().onOrAfter(WORKFLOWS_RESTRICTION_VERSION)) { restriction.writeTo(out); } - if (out.getTransportVersion().onOrAfter(TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS)) { + if (out.getTransportVersion().onOrAfter(ROLE_REMOTE_CLUSTER_PRIVS)) { remoteClusterPermissions.writeTo(out); } - if (out.getTransportVersion().onOrAfter(TransportVersions.SECURITY_ROLE_DESCRIPTION)) { + if (out.getTransportVersion().onOrAfter(SECURITY_ROLE_DESCRIPTION)) { out.writeOptionalString(description); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java index da6ff6ad24c34..b38b33e082382 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java @@ -108,7 +108,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.SECURITY_ROLE_MAPPINGS_IN_CLUSTER_STATE; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/RemoteClusterPermissions.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/RemoteClusterPermissions.java index 2960c5aaa53e7..0d8880c33720b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/RemoteClusterPermissions.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/RemoteClusterPermissions.java @@ -61,13 +61,15 @@ */ public class RemoteClusterPermissions implements NamedWriteable, ToXContentObject { + public static final TransportVersion ROLE_REMOTE_CLUSTER_PRIVS = TransportVersions.V_8_15_0; + public static final String NAME = "remote_cluster_permissions"; private static final Logger logger = LogManager.getLogger(RemoteClusterPermissions.class); private final List remoteClusterPermissionGroups; // package private non-final for testing static Map> allowedRemoteClusterPermissions = Map.of( - TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS, + ROLE_REMOTE_CLUSTER_PRIVS, Set.of(ClusterPrivilegeResolver.MONITOR_ENRICH.name()) ); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/SecurityMigrationTaskParams.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/SecurityMigrationTaskParams.java index 14cc4d3d6f5b9..e69a058914634 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/SecurityMigrationTaskParams.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/SecurityMigrationTaskParams.java @@ -48,7 +48,7 @@ public SecurityMigrationTaskParams(int migrationVersion, boolean migrationNeeded public SecurityMigrationTaskParams(StreamInput in) throws IOException { this.migrationVersion = in.readInt(); - if (in.getTransportVersion().onOrAfter(TransportVersions.SECURITY_MIGRATIONS_MIGRATION_NEEDED_ADDED)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { this.migrationNeeded = in.readBoolean(); } else { this.migrationNeeded = true; @@ -58,7 +58,7 @@ public SecurityMigrationTaskParams(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { out.writeInt(migrationVersion); - if (out.getTransportVersion().onOrAfter(TransportVersions.SECURITY_MIGRATIONS_MIGRATION_NEEDED_ADDED)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeBoolean(migrationNeeded); } } @@ -70,7 +70,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ADD_METADATA_FLATTENED_TO_ROLES; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/GetWatcherSettingsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/GetWatcherSettingsAction.java index f1d046f09b0f7..c6a22ec289be9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/GetWatcherSettingsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/GetWatcherSettingsAction.java @@ -37,7 +37,7 @@ public Request(TimeValue masterNodeTimeout) { } public static Request readFrom(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersions.WATCHER_REQUEST_TIMEOUTS)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { return new Request(in); } else { return new Request(TimeValue.THIRTY_SECONDS); @@ -50,7 +50,7 @@ private Request(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersions.WATCHER_REQUEST_TIMEOUTS)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { super.writeTo(out); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/UpdateWatcherSettingsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/UpdateWatcherSettingsAction.java index 19cc83cda2dbb..42fc7c196bbcf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/UpdateWatcherSettingsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/UpdateWatcherSettingsAction.java @@ -47,7 +47,7 @@ public Request(TimeValue masterNodeTimeout, TimeValue ackTimeout, Map { @Override @@ -47,7 +46,7 @@ protected RankedDocsResults mutateInstance(RankedDocsResults instance) throws IO @Override protected RankedDocsResults mutateInstanceForVersion(RankedDocsResults instance, TransportVersion fromVersion) { - if (fromVersion.onOrAfter(ML_RERANK_DOC_OPTIONAL)) { + if (fromVersion.onOrAfter(TransportVersions.V_8_15_0)) { return instance; } else { var compatibleDocs = rankedDocsNullStringToEmpty(instance.getRankedDocs()); diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsActionResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsActionResponseTests.java index d60bbc6cc7713..1b9d4ebb100b2 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsActionResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsActionResponseTests.java @@ -562,7 +562,7 @@ protected Response mutateInstanceForVersion(Response instance, TransportVersion RESULTS_FIELD ) ); - } else if (version.before(TransportVersions.NODE_STATS_INGEST_BYTES)) { + } else if (version.before(TransportVersions.V_8_15_0)) { // added ByteStats to IngestStats.PipelineStat return new Response( new QueryPage<>( diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferModelActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferModelActionRequestTests.java index 2e4689de787b3..05266e58964c9 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferModelActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferModelActionRequestTests.java @@ -252,7 +252,7 @@ protected Request mutateInstanceForVersion(Request instance, TransportVersion ve r.setHighPriority(instance.isHighPriority()); r.setPrefixType(TrainedModelPrefixStrings.PrefixType.NONE); return r; - } else if (version.before(TransportVersions.ML_CHUNK_INFERENCE_OPTION)) { + } else if (version.before(TransportVersions.V_8_15_0)) { var r = new Request( instance.getId(), adjustedUpdate, diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponseTests.java index 437f58449b4de..ab62073c12d80 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponseTests.java @@ -43,6 +43,7 @@ import java.util.stream.Collectors; import static java.util.Collections.emptySet; +import static org.elasticsearch.xpack.core.security.authz.permission.RemoteClusterPermissions.ROLE_REMOTE_CLUSTER_PRIVS; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -69,7 +70,7 @@ public void testSerialization() throws IOException { public void testSerializationForCurrentVersion() throws Exception { final TransportVersion version = TransportVersionUtils.randomCompatibleVersion(random()); final boolean canIncludeRemoteIndices = version.onOrAfter(TransportVersions.V_8_8_0); - final boolean canIncludeRemoteCluster = version.onOrAfter(TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS); + final boolean canIncludeRemoteCluster = version.onOrAfter(ROLE_REMOTE_CLUSTER_PRIVS); final GetUserPrivilegesResponse original = randomResponse(canIncludeRemoteIndices, canIncludeRemoteCluster); diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationTests.java index 3d4d6106a7eaf..66e246d1c8a50 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationTests.java @@ -44,6 +44,7 @@ import static java.util.Map.entry; import static org.elasticsearch.xpack.core.security.authc.AuthenticationTestHelper.randomCrossClusterAccessSubjectInfo; import static org.elasticsearch.xpack.core.security.authc.CrossClusterAccessSubjectInfoTests.randomRoleDescriptorsIntersection; +import static org.elasticsearch.xpack.core.security.authz.permission.RemoteClusterPermissions.ROLE_REMOTE_CLUSTER_PRIVS; import static org.hamcrest.Matchers.anEmptyMap; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -1108,7 +1109,7 @@ public void testMaybeRewriteMetadataForApiKeyRoleDescriptorsWithRemoteCluster() final Authentication original = AuthenticationTestHelper.builder() .apiKey() .metadata(metadata) - .transportVersion(TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS) + .transportVersion(ROLE_REMOTE_CLUSTER_PRIVS) .build(); // pick a version before that of the authentication instance to force a rewrite diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptorTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptorTests.java index 8e1bc7af1bdc8..94430a4ed5bba 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptorTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptorTests.java @@ -45,10 +45,12 @@ import java.util.Map; import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xpack.core.security.authz.RoleDescriptor.SECURITY_ROLE_DESCRIPTION; import static org.elasticsearch.xpack.core.security.authz.RoleDescriptor.WORKFLOWS_RESTRICTION_VERSION; import static org.elasticsearch.xpack.core.security.authz.RoleDescriptorTestHelper.randomIndicesPrivileges; import static org.elasticsearch.xpack.core.security.authz.RoleDescriptorTestHelper.randomIndicesPrivilegesBuilder; import static org.elasticsearch.xpack.core.security.authz.RoleDescriptorTestHelper.randomRemoteClusterPermissions; +import static org.elasticsearch.xpack.core.security.authz.permission.RemoteClusterPermissions.ROLE_REMOTE_CLUSTER_PRIVS; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; @@ -589,9 +591,9 @@ public void testParsingFieldPermissionsUsesCache() throws IOException { public void testSerializationForCurrentVersion() throws Exception { final TransportVersion version = TransportVersionUtils.randomCompatibleVersion(random()); final boolean canIncludeRemoteIndices = version.onOrAfter(TransportVersions.V_8_8_0); - final boolean canIncludeRemoteClusters = version.onOrAfter(TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS); + final boolean canIncludeRemoteClusters = version.onOrAfter(ROLE_REMOTE_CLUSTER_PRIVS); final boolean canIncludeWorkflows = version.onOrAfter(WORKFLOWS_RESTRICTION_VERSION); - final boolean canIncludeDescription = version.onOrAfter(TransportVersions.SECURITY_ROLE_DESCRIPTION); + final boolean canIncludeDescription = version.onOrAfter(SECURITY_ROLE_DESCRIPTION); logger.info("Testing serialization with version {}", version); BytesStreamOutput output = new BytesStreamOutput(); output.setTransportVersion(version); @@ -667,9 +669,7 @@ public void testSerializationWithRemoteIndicesWithElderVersion() throws IOExcept } public void testSerializationWithRemoteClusterWithElderVersion() throws IOException { - final TransportVersion versionBeforeRemoteCluster = TransportVersionUtils.getPreviousVersion( - TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS - ); + final TransportVersion versionBeforeRemoteCluster = TransportVersionUtils.getPreviousVersion(ROLE_REMOTE_CLUSTER_PRIVS); final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), TransportVersions.V_7_17_0, @@ -815,9 +815,7 @@ public void testParseRoleWithRestrictionWhenAllowRestrictionIsTrue() throws IOEx } public void testSerializationWithDescriptionAndUnsupportedVersions() throws IOException { - final TransportVersion versionBeforeRoleDescription = TransportVersionUtils.getPreviousVersion( - TransportVersions.SECURITY_ROLE_DESCRIPTION - ); + final TransportVersion versionBeforeRoleDescription = TransportVersionUtils.getPreviousVersion(SECURITY_ROLE_DESCRIPTION); final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), TransportVersions.V_7_17_0, diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/permission/RemoteClusterPermissionsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/permission/RemoteClusterPermissionsTests.java index 394455879bbdf..5b5a895f12ae8 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/permission/RemoteClusterPermissionsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/permission/RemoteClusterPermissionsTests.java @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.core.security.authz.permission; import org.elasticsearch.TransportVersion; -import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; @@ -29,6 +28,7 @@ import java.util.Map; import java.util.Set; +import static org.elasticsearch.xpack.core.security.authz.permission.RemoteClusterPermissions.ROLE_REMOTE_CLUSTER_PRIVS; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -163,11 +163,11 @@ public void testMonitorEnrichPerVersion() { // test monitor_enrich before, after and on monitor enrich version String[] privileges = randomBoolean() ? new String[] { "monitor_enrich" } : new String[] { "monitor_enrich", "foo", "bar" }; String[] before = new RemoteClusterPermissions().addGroup(new RemoteClusterPermissionGroup(privileges, new String[] { "*" })) - .privilegeNames("*", TransportVersionUtils.getPreviousVersion(TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS)); + .privilegeNames("*", TransportVersionUtils.getPreviousVersion(ROLE_REMOTE_CLUSTER_PRIVS)); // empty set since monitor_enrich is not allowed in the before version assertThat(Set.of(before), equalTo(Collections.emptySet())); String[] on = new RemoteClusterPermissions().addGroup(new RemoteClusterPermissionGroup(privileges, new String[] { "*" })) - .privilegeNames("*", TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS); + .privilegeNames("*", ROLE_REMOTE_CLUSTER_PRIVS); // only monitor_enrich since the other values are not allowed assertThat(Set.of(on), equalTo(Set.of("monitor_enrich"))); String[] after = new RemoteClusterPermissions().addGroup(new RemoteClusterPermissionGroup(privileges, new String[] { "*" })) diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRule.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRule.java index c14bb8e9a4ec9..e1734268fbf46 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRule.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRule.java @@ -130,7 +130,7 @@ public QueryRule(StreamInput in) throws IOException { this.criteria = in.readCollectionAsList(QueryRuleCriteria::new); this.actions = in.readGenericMap(); - if (in.getTransportVersion().onOrAfter(TransportVersions.QUERY_RULE_CRUD_API_PUT)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { this.priority = in.readOptionalVInt(); } else { this.priority = null; @@ -175,7 +175,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(type.toString()); out.writeCollection(criteria); out.writeGenericMap(actions); - if (out.getTransportVersion().onOrAfter(TransportVersions.QUERY_RULE_CRUD_API_PUT)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeOptionalVInt(priority); } } diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/RuleQueryBuilder.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/RuleQueryBuilder.java index a3703a5005979..3e573929731fb 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/RuleQueryBuilder.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/RuleQueryBuilder.java @@ -88,7 +88,7 @@ public RuleQueryBuilder(StreamInput in) throws IOException { super(in); organicQuery = in.readNamedWriteable(QueryBuilder.class); matchCriteria = in.readGenericMap(); - if (in.getTransportVersion().onOrAfter(TransportVersions.RULE_QUERY_RENAME)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { rulesetIds = in.readStringCollectionAsList(); } else { rulesetIds = List.of(in.readString()); @@ -144,7 +144,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeNamedWriteable(organicQuery); out.writeGenericMap(matchCriteria); - if (out.getTransportVersion().onOrAfter(TransportVersions.RULE_QUERY_RENAME)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeStringCollection(rulesetIds); } else { out.writeString(rulesetIds.get(0)); diff --git a/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/GetQueryRuleActionResponseBWCSerializingTests.java b/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/GetQueryRuleActionResponseBWCSerializingTests.java index b60747ce47321..1f1449d46264b 100644 --- a/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/GetQueryRuleActionResponseBWCSerializingTests.java +++ b/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/GetQueryRuleActionResponseBWCSerializingTests.java @@ -52,8 +52,6 @@ protected GetQueryRuleAction.Response mutateInstanceForVersion(GetQueryRuleActio @Override protected List bwcVersions() { - return getAllBWCVersions().stream() - .filter(v -> v.onOrAfter(TransportVersions.QUERY_RULE_CRUD_API_GET_DELETE)) - .collect(Collectors.toList()); + return getAllBWCVersions().stream().filter(v -> v.onOrAfter(TransportVersions.V_8_15_0)).collect(Collectors.toList()); } } diff --git a/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/GetQueryRulesetActionResponseBWCSerializingTests.java b/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/GetQueryRulesetActionResponseBWCSerializingTests.java index ca58e42ba6248..8bfbcd5ec471b 100644 --- a/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/GetQueryRulesetActionResponseBWCSerializingTests.java +++ b/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/GetQueryRulesetActionResponseBWCSerializingTests.java @@ -61,7 +61,7 @@ protected GetQueryRulesetAction.Response mutateInstanceForVersion(GetQueryRulese rules.add(new QueryRule(rule.id(), rule.type(), newCriteria, rule.actions(), null)); } return new GetQueryRulesetAction.Response(new QueryRuleset(instance.queryRuleset().id(), rules)); - } else if (version.before(TransportVersions.QUERY_RULE_CRUD_API_PUT)) { + } else if (version.before(TransportVersions.V_8_15_0)) { List rules = new ArrayList<>(); for (QueryRule rule : instance.queryRuleset().rules()) { rules.add(new QueryRule(rule.id(), rule.type(), rule.criteria(), rule.actions(), null)); diff --git a/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/PutQueryRuleActionRequestBWCSerializingTests.java b/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/PutQueryRuleActionRequestBWCSerializingTests.java index 5b42a899feac8..b60b8718e8549 100644 --- a/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/PutQueryRuleActionRequestBWCSerializingTests.java +++ b/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/PutQueryRuleActionRequestBWCSerializingTests.java @@ -55,8 +55,6 @@ protected PutQueryRuleAction.Request mutateInstanceForVersion(PutQueryRuleAction @Override protected List bwcVersions() { - return getAllBWCVersions().stream() - .filter(v -> v.onOrAfter(TransportVersions.QUERY_RULE_CRUD_API_PUT)) - .collect(Collectors.toList()); + return getAllBWCVersions().stream().filter(v -> v.onOrAfter(TransportVersions.V_8_15_0)).collect(Collectors.toList()); } } diff --git a/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/PutQueryRulesetActionRequestBWCSerializingTests.java b/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/PutQueryRulesetActionRequestBWCSerializingTests.java index f9b47f5bb2cd2..3b6195cc8f495 100644 --- a/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/PutQueryRulesetActionRequestBWCSerializingTests.java +++ b/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/rules/action/PutQueryRulesetActionRequestBWCSerializingTests.java @@ -63,7 +63,7 @@ protected PutQueryRulesetAction.Request mutateInstanceForVersion(PutQueryRuleset rules.add(new QueryRule(rule.id(), rule.type(), newCriteria, rule.actions(), null)); } return new PutQueryRulesetAction.Request(new QueryRuleset(instance.queryRuleset().id(), rules)); - } else if (version.before(TransportVersions.QUERY_RULE_CRUD_API_PUT)) { + } else if (version.before(TransportVersions.V_8_15_0)) { List rules = new ArrayList<>(); for (QueryRule rule : instance.queryRuleset().rules()) { rules.add(new QueryRule(rule.id(), rule.type(), rule.criteria(), rule.actions(), null)); diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/AbstractArrayBlock.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/AbstractArrayBlock.java index c14289ff2366b..ab125bb868388 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/AbstractArrayBlock.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/AbstractArrayBlock.java @@ -191,8 +191,7 @@ void writeSubFields(StreamOutput out) throws IOException { if (nullsMask != null) { out.writeLongArray(nullsMask.toLongArray()); } - if (out.getTransportVersion().before(TransportVersions.ESQL_MV_ORDERING_SORTED_ASCENDING) - && mvOrdering == MvOrdering.SORTED_ASCENDING) { + if (out.getTransportVersion().before(TransportVersions.V_8_15_0) && mvOrdering == MvOrdering.SORTED_ASCENDING) { out.writeEnum(MvOrdering.UNORDERED); } else { out.writeEnum(mvOrdering); diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/AbstractPageMappingToIteratorOperator.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/AbstractPageMappingToIteratorOperator.java index 4fb4053b0c0f4..32492af157fe6 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/AbstractPageMappingToIteratorOperator.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/AbstractPageMappingToIteratorOperator.java @@ -231,7 +231,7 @@ public String toString() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ESQL_PAGE_MAPPING_TO_ITERATOR; + return TransportVersions.V_8_15_0; } } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/ResolvedEnrichPolicy.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/ResolvedEnrichPolicy.java index 1ee9039ccccb3..e891089aa55b5 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/ResolvedEnrichPolicy.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/ResolvedEnrichPolicy.java @@ -36,7 +36,7 @@ public ResolvedEnrichPolicy(StreamInput in) throws IOException { private static Reader getEsFieldReader(StreamInput in) { if (in.getTransportVersion().onOrAfter(TransportVersions.ESQL_ES_FIELD_CACHED_SERIALIZATION) - || in.getTransportVersion().isPatchFrom(TransportVersions.ESQL_ATTRIBUTE_CACHED_SERIALIZATION_8_15)) { + || in.getTransportVersion().isPatchFrom(TransportVersions.V_8_15_2)) { return EsField::readFrom; } return EsField::new; @@ -57,7 +57,7 @@ public void writeTo(StreamOutput out) throws IOException { (o, v) -> { var field = new EsField(v.getName(), v.getDataType(), v.getProperties(), v.isAggregatable(), v.isAlias()); if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_ES_FIELD_CACHED_SERIALIZATION) - || out.getTransportVersion().isPatchFrom(TransportVersions.ESQL_ATTRIBUTE_CACHED_SERIALIZATION_8_15)) { + || out.getTransportVersion().isPatchFrom(TransportVersions.V_8_15_2)) { field.writeTo(o); } else { field.writeContent(o); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/UnsupportedAttribute.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/UnsupportedAttribute.java index 08c249662c7d2..2c709de7717ce 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/UnsupportedAttribute.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/UnsupportedAttribute.java @@ -78,9 +78,7 @@ private UnsupportedAttribute(StreamInput in) throws IOException { Source.readFrom((PlanStreamInput) in), ((PlanStreamInput) in).readCachedString(), in.getTransportVersion().onOrAfter(TransportVersions.ESQL_ES_FIELD_CACHED_SERIALIZATION) - || in.getTransportVersion().isPatchFrom(TransportVersions.ESQL_ATTRIBUTE_CACHED_SERIALIZATION_8_15) - ? EsField.readFrom(in) - : new UnsupportedEsField(in), + || in.getTransportVersion().isPatchFrom(TransportVersions.V_8_15_2) ? EsField.readFrom(in) : new UnsupportedEsField(in), in.readOptionalString(), NameId.readFrom((PlanStreamInput) in) ); @@ -92,7 +90,7 @@ public void writeTo(StreamOutput out) throws IOException { Source.EMPTY.writeTo(out); ((PlanStreamOutput) out).writeCachedString(name()); if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_ES_FIELD_CACHED_SERIALIZATION) - || out.getTransportVersion().isPatchFrom(TransportVersions.ESQL_ATTRIBUTE_CACHED_SERIALIZATION_8_15)) { + || out.getTransportVersion().isPatchFrom(TransportVersions.V_8_15_2)) { field().writeTo(out); } else { field().writeContent(out); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/io/stream/PlanStreamInput.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/io/stream/PlanStreamInput.java index c832f64363048..9003cbec12d1e 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/io/stream/PlanStreamInput.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/io/stream/PlanStreamInput.java @@ -180,7 +180,7 @@ public NameId mapNameId(long l) { @SuppressWarnings("unchecked") public A readAttributeWithCache(CheckedFunction constructor) throws IOException { if (getTransportVersion().onOrAfter(TransportVersions.ESQL_ATTRIBUTE_CACHED_SERIALIZATION) - || getTransportVersion().isPatchFrom(TransportVersions.ESQL_ATTRIBUTE_CACHED_SERIALIZATION_8_15)) { + || getTransportVersion().isPatchFrom(TransportVersions.V_8_15_2)) { // it's safe to cast to int, since the max value for this is {@link PlanStreamOutput#MAX_SERIALIZED_ATTRIBUTES} int cacheId = Math.toIntExact(readZLong()); if (cacheId < 0) { @@ -220,7 +220,7 @@ private void cacheAttribute(int id, Attribute attr) { @SuppressWarnings("unchecked") public A readEsFieldWithCache() throws IOException { if (getTransportVersion().onOrAfter(TransportVersions.ESQL_ES_FIELD_CACHED_SERIALIZATION) - || getTransportVersion().isPatchFrom(TransportVersions.ESQL_ATTRIBUTE_CACHED_SERIALIZATION_8_15)) { + || getTransportVersion().isPatchFrom(TransportVersions.V_8_15_2)) { // it's safe to cast to int, since the max value for this is {@link PlanStreamOutput#MAX_SERIALIZED_ATTRIBUTES} int cacheId = Math.toIntExact(readZLong()); if (cacheId < 0) { diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/io/stream/PlanStreamOutput.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/io/stream/PlanStreamOutput.java index 5e31a57ed669b..b633b10122eb3 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/io/stream/PlanStreamOutput.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/io/stream/PlanStreamOutput.java @@ -153,7 +153,7 @@ public void writeCachedBlock(Block block) throws IOException { @Override public boolean writeAttributeCacheHeader(Attribute attribute) throws IOException { if (getTransportVersion().onOrAfter(TransportVersions.ESQL_ATTRIBUTE_CACHED_SERIALIZATION) - || getTransportVersion().isPatchFrom(TransportVersions.ESQL_ATTRIBUTE_CACHED_SERIALIZATION_8_15)) { + || getTransportVersion().isPatchFrom(TransportVersions.V_8_15_2)) { Integer cacheId = attributeIdFromCache(attribute); if (cacheId != null) { writeZLong(cacheId); @@ -185,7 +185,7 @@ private int cacheAttribute(Attribute attr) { @Override public boolean writeEsFieldCacheHeader(EsField field) throws IOException { if (getTransportVersion().onOrAfter(TransportVersions.ESQL_ES_FIELD_CACHED_SERIALIZATION) - || getTransportVersion().isPatchFrom(TransportVersions.ESQL_ATTRIBUTE_CACHED_SERIALIZATION_8_15)) { + || getTransportVersion().isPatchFrom(TransportVersions.V_8_15_2)) { Integer cacheId = esFieldIdFromCache(field); if (cacheId != null) { writeZLong(cacheId); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/Aggregate.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/Aggregate.java index 3b7240dcd693b..b2f314a0e8294 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/Aggregate.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/Aggregate.java @@ -40,7 +40,7 @@ public enum AggregateType { METRICS; static void writeType(StreamOutput out, AggregateType type) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_ADD_AGGREGATE_TYPE)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeString(type.name()); } else if (type != STANDARD) { throw new IllegalStateException("cluster is not ready to support aggregate type [" + type + "]"); @@ -48,7 +48,7 @@ static void writeType(StreamOutput out, AggregateType type) throws IOException { } static AggregateType readType(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersions.ESQL_ADD_AGGREGATE_TYPE)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { return AggregateType.valueOf(in.readString()); } else { return STANDARD; diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/EsRelation.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/EsRelation.java index 0043362f23b87..951fc7ad1cf29 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/EsRelation.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/EsRelation.java @@ -87,7 +87,7 @@ public void writeTo(StreamOutput out) throws IOException { } private static boolean supportingEsSourceOptions(TransportVersion version) { - return version.onOrAfter(TransportVersions.V_8_14_0) && version.before(TransportVersions.ESQL_REMOVE_ES_SOURCE_OPTIONS); + return version.between(TransportVersions.V_8_14_0, TransportVersions.V_8_15_0); } @Override @@ -180,7 +180,7 @@ public String nodeString() { } public static IndexMode readIndexMode(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersions.ESQL_ADD_INDEX_MODE_TO_SOURCE)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { return IndexMode.fromString(in.readString()); } else { return IndexMode.STANDARD; @@ -188,7 +188,7 @@ public static IndexMode readIndexMode(StreamInput in) throws IOException { } public static void writeIndexMode(StreamOutput out, IndexMode indexMode) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_ADD_INDEX_MODE_TO_SOURCE)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeString(indexMode.getName()); } else if (indexMode != IndexMode.STANDARD) { throw new IllegalStateException("not ready to support index mode [" + indexMode + "]"); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/EsqlFeatures.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/EsqlFeatures.java index 4b6a38a3e8762..266f07d22eaf5 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/EsqlFeatures.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/EsqlFeatures.java @@ -134,7 +134,6 @@ public class EsqlFeatures implements FeatureSpecification { /** * Blocks can be labelled with {@link org.elasticsearch.compute.data.Block.MvOrdering#SORTED_ASCENDING} for optimizations. - * C.f. {@link org.elasticsearch.TransportVersions#ESQL_MV_ORDERING_SORTED_ASCENDING}. */ public static final NodeFeature MV_ORDERING_SORTED_ASCENDING = new NodeFeature("esql.mv_ordering_sorted_ascending"); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/Configuration.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/Configuration.java index b904f07bcb9c3..4ec2746b24ee4 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/Configuration.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/Configuration.java @@ -96,7 +96,7 @@ public Configuration(BlockStreamInput in) throws IOException { } else { this.profile = false; } - if (in.getTransportVersion().onOrAfter(TransportVersions.ESQL_REQUEST_TABLES)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { this.tables = in.readImmutableMap(i1 -> i1.readImmutableMap(i2 -> new Column((BlockStreamInput) i2))); } else { this.tables = Map.of(); @@ -124,7 +124,7 @@ public void writeTo(StreamOutput out) throws IOException { if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_12_0)) { out.writeBoolean(profile); } - if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_REQUEST_TABLES)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeMap(tables, (o1, columns) -> o1.writeMap(columns, StreamOutput::writeWriteable)); } if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_CCS_EXECUTION_INFO)) { diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/queries/SemanticQueryBuilder.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/queries/SemanticQueryBuilder.java index a33a49cc52d94..478f2e6a21868 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/queries/SemanticQueryBuilder.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/queries/SemanticQueryBuilder.java @@ -132,7 +132,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.SEMANTIC_QUERY; + return TransportVersions.V_8_15_0; } public static SemanticQueryBuilder fromXContent(XContentParser parser) throws IOException { diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankBuilder.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankBuilder.java index fd0ad220faa3b..e4093a91c2359 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankBuilder.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankBuilder.java @@ -98,7 +98,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.TEXT_SIMILARITY_RERANKER_RETRIEVER; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockSecretSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockSecretSettings.java index 30a7dc9ad5a2e..0ca71d47eb1b6 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockSecretSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockSecretSettings.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.inference.services.amazonbedrock; 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; @@ -22,7 +23,6 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.TransportVersions.ML_INFERENCE_AMAZON_BEDROCK_ADDED; import static org.elasticsearch.xpack.inference.services.ServiceUtils.extractRequiredSecureString; import static org.elasticsearch.xpack.inference.services.amazonbedrock.AmazonBedrockConstants.ACCESS_KEY_FIELD; import static org.elasticsearch.xpack.inference.services.amazonbedrock.AmazonBedrockConstants.SECRET_KEY_FIELD; @@ -76,7 +76,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return ML_INFERENCE_AMAZON_BEDROCK_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockService.java index e1ed23a318e6c..96dd6d2b3690f 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockService.java @@ -9,6 +9,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.common.Strings; import org.elasticsearch.core.IOUtils; @@ -46,7 +47,6 @@ import java.util.Map; import java.util.Set; -import static org.elasticsearch.TransportVersions.ML_INFERENCE_AMAZON_BEDROCK_ADDED; import static org.elasticsearch.xpack.inference.services.ServiceUtils.createInvalidModelException; import static org.elasticsearch.xpack.inference.services.ServiceUtils.parsePersistedConfigErrorMsg; import static org.elasticsearch.xpack.inference.services.ServiceUtils.removeFromMapOrDefaultEmpty; @@ -265,7 +265,7 @@ private static AmazonBedrockModel createModel( @Override public TransportVersion getMinimalSupportedVersion() { - return ML_INFERENCE_AMAZON_BEDROCK_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockServiceSettings.java index b572df4f1ee05..f11f5818f635c 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockServiceSettings.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.inference.services.amazonbedrock; 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; @@ -24,7 +25,6 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.TransportVersions.ML_INFERENCE_AMAZON_BEDROCK_ADDED; import static org.elasticsearch.xpack.inference.services.ServiceUtils.extractRequiredEnum; import static org.elasticsearch.xpack.inference.services.ServiceUtils.extractRequiredString; import static org.elasticsearch.xpack.inference.services.amazonbedrock.AmazonBedrockConstants.MODEL_FIELD; @@ -101,7 +101,7 @@ protected AmazonBedrockServiceSettings( @Override public TransportVersion getMinimalSupportedVersion() { - return ML_INFERENCE_AMAZON_BEDROCK_ADDED; + return TransportVersions.V_8_15_0; } public String region() { diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/completion/AmazonBedrockChatCompletionTaskSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/completion/AmazonBedrockChatCompletionTaskSettings.java index c3db1465863e4..65c227bbbd412 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/completion/AmazonBedrockChatCompletionTaskSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/completion/AmazonBedrockChatCompletionTaskSettings.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.inference.services.amazonbedrock.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; @@ -21,7 +22,6 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.TransportVersions.ML_INFERENCE_AMAZON_BEDROCK_ADDED; import static org.elasticsearch.xpack.inference.services.ServiceUtils.extractOptionalDoubleInRange; import static org.elasticsearch.xpack.inference.services.ServiceUtils.extractOptionalPositiveInteger; import static org.elasticsearch.xpack.inference.services.amazonbedrock.AmazonBedrockConstants.MAX_NEW_TOKENS_FIELD; @@ -141,7 +141,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return ML_INFERENCE_AMAZON_BEDROCK_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/anthropic/AnthropicService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/anthropic/AnthropicService.java index 8d6f026e12ac5..c925053c38116 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/anthropic/AnthropicService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/anthropic/AnthropicService.java @@ -198,7 +198,7 @@ protected void doChunkedInfer( @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_ANTHROPIC_INTEGRATION_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/anthropic/completion/AnthropicChatCompletionTaskSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/anthropic/completion/AnthropicChatCompletionTaskSettings.java index e8a6ca638c916..305502d624826 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/anthropic/completion/AnthropicChatCompletionTaskSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/anthropic/completion/AnthropicChatCompletionTaskSettings.java @@ -167,7 +167,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_ANTHROPIC_INTEGRATION_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/AzureAiStudioService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/AzureAiStudioService.java index ba36febc3c162..5525fff6b1a7c 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/AzureAiStudioService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/AzureAiStudioService.java @@ -214,7 +214,7 @@ public String name() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_AZURE_AI_STUDIO; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/completion/AzureAiStudioChatCompletionServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/completion/AzureAiStudioChatCompletionServiceSettings.java index 2f8422be5ed90..ecc8f7fe8e920 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/completion/AzureAiStudioChatCompletionServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/completion/AzureAiStudioChatCompletionServiceSettings.java @@ -80,7 +80,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_AZURE_AI_STUDIO; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/embeddings/AzureAiStudioEmbeddingsServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/embeddings/AzureAiStudioEmbeddingsServiceSettings.java index 8977ba8b12836..6ae1f773853d1 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/embeddings/AzureAiStudioEmbeddingsServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/embeddings/AzureAiStudioEmbeddingsServiceSettings.java @@ -166,7 +166,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_AZURE_AI_STUDIO; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/AzureOpenAiService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/AzureOpenAiService.java index e1c230b98a2f7..cd657113d7b61 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/AzureOpenAiService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/AzureOpenAiService.java @@ -324,7 +324,7 @@ private AzureOpenAiEmbeddingsModel updateModelWithEmbeddingDetails(AzureOpenAiEm @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_RATE_LIMIT_SETTINGS_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/completion/AzureOpenAiCompletionServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/completion/AzureOpenAiCompletionServiceSettings.java index 16f58574a8068..eb7eed2cedb41 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/completion/AzureOpenAiCompletionServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/completion/AzureOpenAiCompletionServiceSettings.java @@ -168,7 +168,7 @@ protected XContentBuilder toXContentFragmentOfExposedFields(XContentBuilder buil @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_AZURE_OPENAI_COMPLETIONS; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/completion/AzureOpenAiCompletionTaskSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/completion/AzureOpenAiCompletionTaskSettings.java index 3008a543b8fea..7f90b866a2eab 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/completion/AzureOpenAiCompletionTaskSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/completion/AzureOpenAiCompletionTaskSettings.java @@ -88,7 +88,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_AZURE_OPENAI_COMPLETIONS; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/embeddings/AzureOpenAiEmbeddingsServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/embeddings/AzureOpenAiEmbeddingsServiceSettings.java index 941a4bdeeb41a..9e8ca478987ec 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/embeddings/AzureOpenAiEmbeddingsServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureopenai/embeddings/AzureOpenAiEmbeddingsServiceSettings.java @@ -185,7 +185,7 @@ public AzureOpenAiEmbeddingsServiceSettings(StreamInput in) throws IOException { maxInputTokens = in.readOptionalVInt(); similarity = in.readOptionalEnum(SimilarityMeasure.class); - if (in.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_RATE_LIMIT_SETTINGS_ADDED)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { rateLimitSettings = new RateLimitSettings(in); } else { rateLimitSettings = DEFAULT_RATE_LIMIT_SETTINGS; @@ -303,7 +303,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalVInt(maxInputTokens); out.writeOptionalEnum(SimilarityMeasure.translateSimilarity(similarity, out.getTransportVersion())); - if (out.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_RATE_LIMIT_SETTINGS_ADDED)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { rateLimitSettings.writeTo(out); } } diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/CohereService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/CohereService.java index 9538588700e75..ce0fa0a885a20 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/CohereService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/CohereService.java @@ -325,7 +325,7 @@ static SimilarityMeasure defaultSimilarity() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_RATE_LIMIT_SETTINGS_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/CohereServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/CohereServiceSettings.java index 7f28459e9b8be..a1943b339a561 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/CohereServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/CohereServiceSettings.java @@ -124,7 +124,7 @@ public CohereServiceSettings(StreamInput in) throws IOException { maxInputTokens = in.readOptionalVInt(); modelId = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_RATE_LIMIT_SETTINGS_ADDED)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { rateLimitSettings = new RateLimitSettings(in); } else { rateLimitSettings = DEFAULT_RATE_LIMIT_SETTINGS; @@ -219,7 +219,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalVInt(maxInputTokens); out.writeOptionalString(modelId); - if (out.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_RATE_LIMIT_SETTINGS_ADDED)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { rateLimitSettings.writeTo(out); } } diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/completion/CohereCompletionServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/completion/CohereCompletionServiceSettings.java index ba9e81b461f9f..be241f3aaa7fc 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/completion/CohereCompletionServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/completion/CohereCompletionServiceSettings.java @@ -114,7 +114,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_COHERE_COMPLETION_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/rerank/CohereRerankServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/rerank/CohereRerankServiceSettings.java index 1132dff34ed6e..a3d2483a068e2 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/rerank/CohereRerankServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/rerank/CohereRerankServiceSettings.java @@ -101,7 +101,7 @@ public CohereRerankServiceSettings(StreamInput in) throws IOException { this.modelId = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_RATE_LIMIT_SETTINGS_ADDED)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { this.rateLimitSettings = new RateLimitSettings(in); } else { this.rateLimitSettings = DEFAULT_RATE_LIMIT_SETTINGS; @@ -172,7 +172,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(modelId); - if (out.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_RATE_LIMIT_SETTINGS_ADDED)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { rateLimitSettings.writeTo(out); } } diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/CustomElandInternalTextEmbeddingServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/CustomElandInternalTextEmbeddingServiceSettings.java index 381c97969e79f..133be5e2b7623 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/CustomElandInternalTextEmbeddingServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/CustomElandInternalTextEmbeddingServiceSettings.java @@ -139,7 +139,7 @@ public CustomElandInternalTextEmbeddingServiceSettings( public CustomElandInternalTextEmbeddingServiceSettings(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_ELAND_SETTINGS_ADDED)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { dimensions = in.readOptionalVInt(); similarityMeasure = in.readEnum(SimilarityMeasure.class); elementType = in.readEnum(DenseVectorFieldMapper.ElementType.class); @@ -197,7 +197,7 @@ public String getWriteableName() { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_ELAND_SETTINGS_ADDED)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { out.writeOptionalVInt(dimensions); out.writeEnum(similarityMeasure); out.writeEnum(elementType); diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/GoogleAiStudioService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/GoogleAiStudioService.java index c685441271194..f583caeac8ee3 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/GoogleAiStudioService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/GoogleAiStudioService.java @@ -213,7 +213,7 @@ public Model parsePersistedConfig(String inferenceEntityId, TaskType taskType, M @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_GOOGLE_AI_STUDIO_COMPLETION_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/completion/GoogleAiStudioCompletionServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/completion/GoogleAiStudioCompletionServiceSettings.java index 7c0b812ee213b..676fec13d1ddc 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/completion/GoogleAiStudioCompletionServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/completion/GoogleAiStudioCompletionServiceSettings.java @@ -102,7 +102,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_GOOGLE_AI_STUDIO_COMPLETION_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/embeddings/GoogleAiStudioEmbeddingsServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/embeddings/GoogleAiStudioEmbeddingsServiceSettings.java index 7608f48d0638d..2ddf8efcbc112 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/embeddings/GoogleAiStudioEmbeddingsServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/embeddings/GoogleAiStudioEmbeddingsServiceSettings.java @@ -154,7 +154,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_GOOGLE_AI_STUDIO_EMBEDDINGS_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiSecretSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiSecretSettings.java index 20dbadb9b3eae..44e16fa058506 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiSecretSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiSecretSettings.java @@ -82,7 +82,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_GOOGLE_VERTEX_AI_EMBEDDINGS_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiService.java index ece23d4226fcd..36fb183f6de70 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiService.java @@ -151,7 +151,7 @@ public Model parsePersistedConfig(String inferenceEntityId, TaskType taskType, M @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_GOOGLE_VERTEX_AI_EMBEDDINGS_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/embeddings/GoogleVertexAiEmbeddingsServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/embeddings/GoogleVertexAiEmbeddingsServiceSettings.java index 097ce6240439b..32c3008a802c2 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/embeddings/GoogleVertexAiEmbeddingsServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/embeddings/GoogleVertexAiEmbeddingsServiceSettings.java @@ -215,7 +215,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_GOOGLE_VERTEX_AI_EMBEDDINGS_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/embeddings/GoogleVertexAiEmbeddingsTaskSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/embeddings/GoogleVertexAiEmbeddingsTaskSettings.java index b7242100178a3..dcdbbda33575f 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/embeddings/GoogleVertexAiEmbeddingsTaskSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/embeddings/GoogleVertexAiEmbeddingsTaskSettings.java @@ -78,7 +78,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_GOOGLE_VERTEX_AI_EMBEDDINGS_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/rerank/GoogleVertexAiRerankServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/rerank/GoogleVertexAiRerankServiceSettings.java index 431f704c10091..d123d14b67f0e 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/rerank/GoogleVertexAiRerankServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/rerank/GoogleVertexAiRerankServiceSettings.java @@ -99,7 +99,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_GOOGLE_VERTEX_AI_RERANKING_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/rerank/GoogleVertexAiRerankTaskSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/rerank/GoogleVertexAiRerankTaskSettings.java index 64bec7e6cfeef..0bc3df581d7b2 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/rerank/GoogleVertexAiRerankTaskSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/rerank/GoogleVertexAiRerankTaskSettings.java @@ -75,7 +75,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_GOOGLE_VERTEX_AI_RERANKING_ADDED; + return TransportVersions.V_8_15_0; } @Override diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/HuggingFaceService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/HuggingFaceService.java index 14af29bab9078..752d1dd605cd7 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/HuggingFaceService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/HuggingFaceService.java @@ -144,6 +144,6 @@ public String name() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersions.ML_INFERENCE_RATE_LIMIT_SETTINGS_ADDED; + return TransportVersions.V_8_15_0; } } diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/HuggingFaceServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/HuggingFaceServiceSettings.java index c136e73a0c452..7429153835ee3 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/HuggingFaceServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/HuggingFaceServiceSettings.java @@ -120,7 +120,7 @@ public HuggingFaceServiceSettings(StreamInput in) throws IOException { maxInputTokens = null; } - if (in.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_RATE_LIMIT_SETTINGS_ADDED)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { rateLimitSettings = new RateLimitSettings(in); } else { rateLimitSettings = DEFAULT_RATE_LIMIT_SETTINGS; @@ -171,7 +171,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalVInt(maxInputTokens); } - if (out.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_RATE_LIMIT_SETTINGS_ADDED)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { rateLimitSettings.writeTo(out); } } diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/elser/HuggingFaceElserServiceSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/elser/HuggingFaceElserServiceSettings.java index b48e71867ea6d..be5f595d2c0fb 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/elser/HuggingFaceElserServiceSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/elser/HuggingFaceElserServiceSettings.java @@ -76,7 +76,7 @@ public HuggingFaceElserServiceSettings(String url) { public HuggingFaceElserServiceSettings(StreamInput in) throws IOException { uri = createUri(in.readString()); - if (in.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_RATE_LIMIT_SETTINGS_ADDED)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { rateLimitSettings = new RateLimitSettings(in); } else { rateLimitSettings = DEFAULT_RATE_LIMIT_SETTINGS; @@ -134,7 +134,7 @@ public TransportVersion getMinimalSupportedVersion() { public void writeTo(StreamOutput out) throws IOException { out.writeString(uri.toString()); - if (out.getTransportVersion().onOrAfter(TransportVersions.ML_INFERENCE_RATE_LIMIT_SETTINGS_ADDED)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { rateLimitSettings.writeTo(out); } } diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/mistral/MistralService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/mistral/MistralService.java index 8af817d06fefa..8ae9b91b599d9 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/mistral/MistralService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/mistral/MistralService.java @@ -9,6 +9,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; @@ -41,7 +42,6 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.TransportVersions.ADD_MISTRAL_EMBEDDINGS_INFERENCE; import static org.elasticsearch.xpack.inference.services.ServiceUtils.createInvalidModelException; import static org.elasticsearch.xpack.inference.services.ServiceUtils.parsePersistedConfigErrorMsg; import static org.elasticsearch.xpack.inference.services.ServiceUtils.removeFromMapOrDefaultEmpty; @@ -206,7 +206,7 @@ public Model parsePersistedConfig(String modelId, TaskType taskType, Map PARSER = new ConstructingObjectParser<>(NAME, a -> { diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java index 90566e25b4ea5..c4cf3127b897c 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java @@ -139,7 +139,6 @@ import java.util.stream.Collectors; import static org.elasticsearch.TransportVersions.ADD_MANAGE_ROLES_PRIVILEGE; -import static org.elasticsearch.TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS; import static org.elasticsearch.core.Strings.format; import static org.elasticsearch.search.SearchService.DEFAULT_KEEPALIVE_SETTING; import static org.elasticsearch.transport.RemoteClusterPortSettings.TRANSPORT_VERSION_ADVANCED_REMOTE_CLUSTER_SECURITY; @@ -148,6 +147,7 @@ import static org.elasticsearch.xpack.core.ClientHelper.SECURITY_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; import static org.elasticsearch.xpack.core.security.authz.RoleDescriptor.WORKFLOWS_RESTRICTION_VERSION; +import static org.elasticsearch.xpack.core.security.authz.permission.RemoteClusterPermissions.ROLE_REMOTE_CLUSTER_PRIVS; import static org.elasticsearch.xpack.security.Security.SECURITY_CRYPTO_THREAD_POOL_NAME; import static org.elasticsearch.xpack.security.support.SecurityIndexManager.Availability.PRIMARY_SHARDS; import static org.elasticsearch.xpack.security.support.SecurityIndexManager.Availability.SEARCH_SHARDS; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java index 9ddda193dba39..7c242fb07b681 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java @@ -81,7 +81,6 @@ import java.util.function.BiConsumer; import java.util.function.Supplier; -import static org.elasticsearch.TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS; import static org.elasticsearch.action.ValidateActions.addValidationError; import static org.elasticsearch.index.query.QueryBuilders.existsQuery; import static org.elasticsearch.search.SearchService.DEFAULT_KEEPALIVE_SETTING; @@ -91,6 +90,8 @@ import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; import static org.elasticsearch.xpack.core.security.SecurityField.DOCUMENT_LEVEL_SECURITY_FEATURE; import static org.elasticsearch.xpack.core.security.authz.RoleDescriptor.ROLE_TYPE; +import static org.elasticsearch.xpack.core.security.authz.RoleDescriptor.SECURITY_ROLE_DESCRIPTION; +import static org.elasticsearch.xpack.core.security.authz.permission.RemoteClusterPermissions.ROLE_REMOTE_CLUSTER_PRIVS; import static org.elasticsearch.xpack.security.support.SecurityIndexManager.Availability.PRIMARY_SHARDS; import static org.elasticsearch.xpack.security.support.SecurityIndexManager.Availability.SEARCH_SHARDS; import static org.elasticsearch.xpack.security.support.SecurityMigrations.ROLE_METADATA_FLATTENED_MIGRATION_VERSION; @@ -468,24 +469,25 @@ private Exception validateRoleDescriptor(RoleDescriptor role) { } else if (role.hasRemoteClusterPermissions() && clusterService.state().getMinTransportVersion().before(ROLE_REMOTE_CLUSTER_PRIVS)) { return new IllegalStateException( - "all nodes must have version [" + ROLE_REMOTE_CLUSTER_PRIVS + "] or higher to support remote cluster privileges" + "all nodes must have version [" + + ROLE_REMOTE_CLUSTER_PRIVS.toReleaseVersion() + + "] or higher to support remote cluster privileges" ); - } else if (role.hasDescription() - && clusterService.state().getMinTransportVersion().before(TransportVersions.SECURITY_ROLE_DESCRIPTION)) { + } else if (role.hasDescription() && clusterService.state().getMinTransportVersion().before(SECURITY_ROLE_DESCRIPTION)) { + return new IllegalStateException( + "all nodes must have version [" + + SECURITY_ROLE_DESCRIPTION.toReleaseVersion() + + "] or higher to support specifying role description" + ); + } else if (Arrays.stream(role.getConditionalClusterPrivileges()) + .anyMatch(privilege -> privilege instanceof ConfigurableClusterPrivileges.ManageRolesPrivilege) + && clusterService.state().getMinTransportVersion().before(TransportVersions.ADD_MANAGE_ROLES_PRIVILEGE)) { return new IllegalStateException( "all nodes must have version [" - + TransportVersions.SECURITY_ROLE_DESCRIPTION.toReleaseVersion() - + "] or higher to support specifying role description" + + TransportVersions.ADD_MANAGE_ROLES_PRIVILEGE.toReleaseVersion() + + "] or higher to support the manage roles privilege" ); - } else if (Arrays.stream(role.getConditionalClusterPrivileges()) - .anyMatch(privilege -> privilege instanceof ConfigurableClusterPrivileges.ManageRolesPrivilege) - && clusterService.state().getMinTransportVersion().before(TransportVersions.ADD_MANAGE_ROLES_PRIVILEGE)) { - return new IllegalStateException( - "all nodes must have version [" - + TransportVersions.ADD_MANAGE_ROLES_PRIVILEGE.toReleaseVersion() - + "] or higher to support the manage roles privilege" - ); - } + } try { DLSRoleQueryValidator.validateQueryField(role.getIndicesPrivileges(), xContentRegistry); } catch (ElasticsearchException | IllegalArgumentException e) { @@ -645,8 +647,7 @@ XContentBuilder createRoleXContentBuilder(RoleDescriptor role) throws IOExceptio && clusterService.state().getMinTransportVersion().onOrAfter(ROLE_REMOTE_CLUSTER_PRIVS)) { builder.array(RoleDescriptor.Fields.REMOTE_CLUSTER.getPreferredName(), RemoteClusterPermissions.NONE); } - if (role.hasDescription() == false - && clusterService.state().getMinTransportVersion().onOrAfter(TransportVersions.SECURITY_ROLE_DESCRIPTION)) { + if (role.hasDescription() == false && clusterService.state().getMinTransportVersion().onOrAfter(SECURITY_ROLE_DESCRIPTION)) { builder.field(RoleDescriptor.Fields.DESCRIPTION.getPreferredName(), ""); } diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java index fa6eb307933ec..996291c52c71f 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java @@ -158,7 +158,6 @@ import java.util.stream.IntStream; import java.util.stream.LongStream; -import static org.elasticsearch.TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS; import static org.elasticsearch.index.seqno.SequenceNumbers.UNASSIGNED_PRIMARY_TERM; import static org.elasticsearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; import static org.elasticsearch.test.ActionListenerUtils.anyActionListener; @@ -170,6 +169,7 @@ import static org.elasticsearch.xpack.core.security.authc.AuthenticationField.API_KEY_METADATA_KEY; import static org.elasticsearch.xpack.core.security.authc.AuthenticationField.API_KEY_TYPE_KEY; import static org.elasticsearch.xpack.core.security.authz.RoleDescriptor.WORKFLOWS_RESTRICTION_VERSION; +import static org.elasticsearch.xpack.core.security.authz.permission.RemoteClusterPermissions.ROLE_REMOTE_CLUSTER_PRIVS; import static org.elasticsearch.xpack.core.security.authz.store.ReservedRolesStore.SUPERUSER_ROLE_DESCRIPTOR; import static org.elasticsearch.xpack.core.security.test.TestRestrictedIndices.INTERNAL_SECURITY_MAIN_INDEX_7; import static org.elasticsearch.xpack.security.Security.SECURITY_CRYPTO_THREAD_POOL_NAME; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStoreTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStoreTests.java index bfa358d0b7d6e..2b8a77d63588a 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStoreTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStoreTests.java @@ -98,6 +98,7 @@ import static org.elasticsearch.xpack.core.security.authz.RoleDescriptorTestHelper.randomClusterPrivileges; import static org.elasticsearch.xpack.core.security.authz.RoleDescriptorTestHelper.randomRemoteIndicesPrivileges; import static org.elasticsearch.xpack.core.security.authz.RoleDescriptorTestHelper.randomRoleDescriptorMetadata; +import static org.elasticsearch.xpack.core.security.authz.permission.RemoteClusterPermissions.ROLE_REMOTE_CLUSTER_PRIVS; import static org.elasticsearch.xpack.security.support.SecuritySystemIndices.SECURITY_MAIN_ALIAS; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.contains; @@ -488,7 +489,7 @@ enum TEST_MODE { switch (testMode) { case REMOTE_CLUSTER_PRIVS -> { transportVersionBeforeAdvancedRemoteClusterSecurity = TransportVersionUtils.getPreviousVersion( - TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS + ROLE_REMOTE_CLUSTER_PRIVS ); remoteIndicesPrivileges = null; } @@ -549,7 +550,7 @@ enum TEST_MODE { containsString( "all nodes must have version [" + (TEST_MODE.REMOTE_CLUSTER_PRIVS.equals(testMode) - ? TransportVersions.ROLE_REMOTE_CLUSTER_PRIVS + ? ROLE_REMOTE_CLUSTER_PRIVS.toReleaseVersion() : TRANSPORT_VERSION_ADVANCED_REMOTE_CLUSTER_SECURITY.toReleaseVersion()) + "] or higher to support remote " + (remoteIndicesPrivileges != null ? "indices" : "cluster") diff --git a/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/RolesBackwardsCompatibilityIT.java b/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/RolesBackwardsCompatibilityIT.java index 650779cfbc85d..ea1b2cdac5a1f 100644 --- a/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/RolesBackwardsCompatibilityIT.java +++ b/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/RolesBackwardsCompatibilityIT.java @@ -27,6 +27,7 @@ import java.util.Map; import java.util.Set; +import static org.elasticsearch.xpack.core.security.authz.RoleDescriptor.SECURITY_ROLE_DESCRIPTION; import static org.elasticsearch.xpack.core.security.authz.RoleDescriptorTestHelper.randomApplicationPrivileges; import static org.elasticsearch.xpack.core.security.authz.RoleDescriptorTestHelper.randomIndicesPrivileges; import static org.elasticsearch.xpack.core.security.authz.RoleDescriptorTestHelper.randomManageRolesPrivileges; @@ -43,8 +44,8 @@ public class RolesBackwardsCompatibilityIT extends AbstractUpgradeTestCase { public void testRolesWithDescription() throws Exception { assumeTrue( - "The role description is supported after transport version: " + TransportVersions.SECURITY_ROLE_DESCRIPTION, - minimumTransportVersion().before(TransportVersions.SECURITY_ROLE_DESCRIPTION) + "The role description is supported after transport version: " + SECURITY_ROLE_DESCRIPTION, + minimumTransportVersion().before(SECURITY_ROLE_DESCRIPTION) ); switch (CLUSTER_TYPE) { case OLD -> { @@ -75,7 +76,7 @@ public void testRolesWithDescription() throws Exception { } case MIXED -> { try { - this.createClientsByVersion(TransportVersions.SECURITY_ROLE_DESCRIPTION); + this.createClientsByVersion(SECURITY_ROLE_DESCRIPTION); // succeed when role description is not provided final String initialRole = randomRoleDescriptorSerialized(); createRole(client(), "my-valid-mixed-role", initialRole); @@ -116,7 +117,7 @@ public void testRolesWithDescription() throws Exception { e.getMessage(), containsString( "all nodes must have version [" - + TransportVersions.SECURITY_ROLE_DESCRIPTION.toReleaseVersion() + + SECURITY_ROLE_DESCRIPTION.toReleaseVersion() + "] or higher to support specifying role description" ) ); @@ -130,7 +131,7 @@ public void testRolesWithDescription() throws Exception { e.getMessage(), containsString( "all nodes must have version [" - + TransportVersions.SECURITY_ROLE_DESCRIPTION.toReleaseVersion() + + SECURITY_ROLE_DESCRIPTION.toReleaseVersion() + "] or higher to support specifying role description" ) );