Skip to content

Commit 47c5150

Browse files
authored
Revert "Remove transport versions 8840_000 through 8798_000 (#136229)" (#136565)
This reverts commit f74e8e4. elastic/elasticsearch-serverless#4688
1 parent 94b1ad4 commit 47c5150

File tree

79 files changed

+808
-187
lines changed

Some content is hidden

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

79 files changed

+808
-187
lines changed

qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/AddIndexBlockRollingUpgradeIT.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import com.carrotsearch.randomizedtesting.annotations.Name;
1515

16+
import org.elasticsearch.TransportVersions;
1617
import org.elasticsearch.client.Request;
1718
import org.elasticsearch.client.ResponseException;
1819
import org.elasticsearch.cluster.metadata.IndexMetadata;
@@ -37,15 +38,20 @@ public void testAddBlock() throws Exception {
3738
createIndex(INDEX_NAME);
3839
} else if (isMixedCluster()) {
3940
blockWrites();
40-
assertThat(verifiedSettingValue(), Matchers.equalTo("true"));
41+
// this is used both for upgrading from 9.0.0 to current and from 8.18 to current.
42+
if (minimumTransportVersion().before(TransportVersions.ADD_INDEX_BLOCK_TWO_PHASE)) {
43+
assertNull(verifiedSettingValue());
44+
} else {
45+
assertThat(verifiedSettingValue(), Matchers.equalTo("true"));
4146

42-
expectThrows(
43-
ResponseException.class,
44-
() -> updateIndexSettings(
45-
INDEX_NAME,
46-
Settings.builder().putNull(MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING.getKey())
47-
)
48-
);
47+
expectThrows(
48+
ResponseException.class,
49+
() -> updateIndexSettings(
50+
INDEX_NAME,
51+
Settings.builder().putNull(MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING.getKey())
52+
)
53+
);
54+
}
4955
} else {
5056
assertTrue(isUpgradedCluster());
5157
blockWrites();

server/src/main/java/org/elasticsearch/TransportVersions.java

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,50 @@ static TransportVersion def(int id) {
9393
public static final TransportVersion V_8_17_0 = def(8_797_0_02);
9494
public static final TransportVersion INITIAL_ELASTICSEARCH_8_17_3 = def(8_797_0_03);
9595
public static final TransportVersion INITIAL_ELASTICSEARCH_8_17_4 = def(8_797_0_04);
96-
// TODO: leave this version until the very end to satisfy max transport version test
9796
public static final TransportVersion INITIAL_ELASTICSEARCH_8_17_5 = def(8_797_0_05);
97+
public static final TransportVersion INDEXING_PRESSURE_THROTTLING_STATS = def(8_798_0_00);
98+
public static final TransportVersion REINDEX_DATA_STREAMS = def(8_799_0_00);
99+
public static final TransportVersion ESQL_REMOVE_NODE_LEVEL_PLAN = def(8_800_0_00);
100+
public static final TransportVersion LOGSDB_TELEMETRY_CUSTOM_CUTOFF_DATE = def(8_801_0_00);
101+
public static final TransportVersion SOURCE_MODE_TELEMETRY = def(8_802_0_00);
102+
public static final TransportVersion NEW_REFRESH_CLUSTER_BLOCK = def(8_803_0_00);
103+
public static final TransportVersion RETRIES_AND_OPERATIONS_IN_BLOBSTORE_STATS = def(8_804_0_00);
104+
public static final TransportVersion ADD_DATA_STREAM_OPTIONS_TO_TEMPLATES = def(8_805_0_00);
105+
public static final TransportVersion KNN_QUERY_RESCORE_OVERSAMPLE = def(8_806_0_00);
106+
public static final TransportVersion SEMANTIC_QUERY_LENIENT = def(8_807_0_00);
107+
public static final TransportVersion ESQL_QUERY_BUILDER_IN_SEARCH_FUNCTIONS = def(8_808_0_00);
108+
public static final TransportVersion EQL_ALLOW_PARTIAL_SEARCH_RESULTS = def(8_809_0_00);
109+
public static final TransportVersion NODE_VERSION_INFORMATION_WITH_MIN_READ_ONLY_INDEX_VERSION = def(8_810_0_00);
110+
public static final TransportVersion ERROR_TRACE_IN_TRANSPORT_HEADER = def(8_811_0_00);
111+
public static final TransportVersion FAILURE_STORE_ENABLED_BY_CLUSTER_SETTING = def(8_812_0_00);
112+
public static final TransportVersion SIMULATE_IGNORED_FIELDS = def(8_813_0_00);
113+
public static final TransportVersion TRANSFORMS_UPGRADE_MODE = def(8_814_0_00);
114+
public static final TransportVersion NODE_SHUTDOWN_EPHEMERAL_ID_ADDED = def(8_815_0_00);
115+
public static final TransportVersion ESQL_CCS_TELEMETRY_STATS = def(8_816_0_00);
116+
public static final TransportVersion TEXT_EMBEDDING_QUERY_VECTOR_BUILDER_INFER_MODEL_ID = def(8_817_0_00);
117+
public static final TransportVersion ESQL_ENABLE_NODE_LEVEL_REDUCTION = def(8_818_0_00);
118+
public static final TransportVersion JINA_AI_INTEGRATION_ADDED = def(8_819_0_00);
119+
public static final TransportVersion TRACK_INDEX_FAILED_DUE_TO_VERSION_CONFLICT_METRIC = def(8_820_0_00);
120+
public static final TransportVersion REPLACE_FAILURE_STORE_OPTIONS_WITH_SELECTOR_SYNTAX = def(8_821_0_00);
121+
public static final TransportVersion ELASTIC_INFERENCE_SERVICE_UNIFIED_CHAT_COMPLETIONS_INTEGRATION = def(8_822_0_00);
122+
public static final TransportVersion KQL_QUERY_TECH_PREVIEW = def(8_823_0_00);
123+
public static final TransportVersion ESQL_PROFILE_ROWS_PROCESSED = def(8_824_0_00);
124+
public static final TransportVersion BYTE_SIZE_VALUE_ALWAYS_USES_BYTES_1 = def(8_825_0_00);
125+
public static final TransportVersion REVERT_BYTE_SIZE_VALUE_ALWAYS_USES_BYTES_1 = def(8_826_0_00);
126+
public static final TransportVersion ESQL_SKIP_ES_INDEX_SERIALIZATION = def(8_827_0_00);
127+
public static final TransportVersion ADD_INDEX_BLOCK_TWO_PHASE = def(8_828_0_00);
128+
public static final TransportVersion RESOLVE_CLUSTER_NO_INDEX_EXPRESSION = def(8_829_0_00);
129+
public static final TransportVersion ML_ROLLOVER_LEGACY_INDICES = def(8_830_0_00);
130+
public static final TransportVersion ADD_INCLUDE_FAILURE_INDICES_OPTION = def(8_831_0_00);
131+
public static final TransportVersion ESQL_RESPONSE_PARTIAL = def(8_832_0_00);
132+
public static final TransportVersion RANK_DOC_OPTIONAL_METADATA_FOR_EXPLAIN = def(8_833_0_00);
133+
public static final TransportVersion ILM_ADD_SEARCHABLE_SNAPSHOT_ADD_REPLICATE_FOR = def(8_834_0_00);
134+
public static final TransportVersion INGEST_REQUEST_INCLUDE_SOURCE_ON_ERROR = def(8_835_0_00);
135+
public static final TransportVersion RESOURCE_DEPRECATION_CHECKS = def(8_836_0_00);
136+
public static final TransportVersion LINEAR_RETRIEVER_SUPPORT = def(8_837_0_00);
137+
public static final TransportVersion TIMEOUT_GET_PARAM_FOR_RESOLVE_CLUSTER = def(8_838_0_00);
138+
public static final TransportVersion INFERENCE_REQUEST_ADAPTIVE_RATE_LIMITING = def(8_839_0_00);
139+
public static final TransportVersion ML_INFERENCE_IBM_WATSONX_RERANK_ADDED = def(8_840_0_00);
98140

99141
/*
100142
* STOP! READ THIS FIRST! No, really,

server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ public ClusterStatsNodeResponse(StreamInput in) throws IOException {
5252
repositoryUsageStats = RepositoryUsageStats.EMPTY;
5353
searchCcsMetrics = new CCSTelemetrySnapshot();
5454
}
55-
esqlCcsMetrics = new CCSTelemetrySnapshot(in);
55+
if (in.getTransportVersion().onOrAfter(TransportVersions.ESQL_CCS_TELEMETRY_STATS)) {
56+
esqlCcsMetrics = new CCSTelemetrySnapshot(in);
57+
} else {
58+
esqlCcsMetrics = new CCSTelemetrySnapshot();
59+
}
5660
}
5761

5862
public ClusterStatsNodeResponse(
@@ -127,7 +131,9 @@ public void writeTo(StreamOutput out) throws IOException {
127131
repositoryUsageStats.writeTo(out);
128132
searchCcsMetrics.writeTo(out);
129133
} // else just drop these stats, ok for bwc
130-
esqlCcsMetrics.writeTo(out);
134+
if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_CCS_TELEMETRY_STATS)) {
135+
esqlCcsMetrics.writeTo(out);
136+
}
131137
}
132138

133139
}

server/src/main/java/org/elasticsearch/action/admin/cluster/stats/MappingStats.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
package org.elasticsearch.action.admin.cluster.stats;
1111

12+
import org.elasticsearch.TransportVersion;
1213
import org.elasticsearch.TransportVersions;
1314
import org.elasticsearch.cluster.metadata.IndexMetadata;
1415
import org.elasticsearch.cluster.metadata.MappingMetadata;
@@ -269,7 +270,9 @@ private static int countOccurrences(String script, Pattern pattern) {
269270
fieldTypeStats = in.readCollectionAsImmutableList(FieldStats::new);
270271
runtimeFieldStats = in.readCollectionAsImmutableList(RuntimeFieldStats::new);
271272
var transportVersion = in.getTransportVersion();
272-
sourceModeUsageCount = in.readImmutableMap(StreamInput::readString, StreamInput::readVInt);
273+
sourceModeUsageCount = canReadOrWriteSourceModeTelemetry(transportVersion)
274+
? in.readImmutableMap(StreamInput::readString, StreamInput::readVInt)
275+
: Map.of();
273276
}
274277

275278
@Override
@@ -281,7 +284,14 @@ public void writeTo(StreamOutput out) throws IOException {
281284
}
282285
out.writeCollection(fieldTypeStats);
283286
out.writeCollection(runtimeFieldStats);
284-
out.writeMap(sourceModeUsageCount, StreamOutput::writeVInt);
287+
var transportVersion = out.getTransportVersion();
288+
if (canReadOrWriteSourceModeTelemetry(transportVersion)) {
289+
out.writeMap(sourceModeUsageCount, StreamOutput::writeVInt);
290+
}
291+
}
292+
293+
private static boolean canReadOrWriteSourceModeTelemetry(TransportVersion version) {
294+
return version.isPatchFrom(TransportVersions.V_8_17_0) || version.onOrAfter(TransportVersions.SOURCE_MODE_TELEMETRY);
285295
}
286296

287297
private static OptionalLong ofNullable(Long l) {

server/src/main/java/org/elasticsearch/action/admin/indices/readonly/AddIndexBlockRequest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
package org.elasticsearch.action.admin.indices.readonly;
1111

12+
import org.elasticsearch.TransportVersions;
1213
import org.elasticsearch.action.ActionRequestValidationException;
1314
import org.elasticsearch.action.IndicesRequest;
1415
import org.elasticsearch.action.support.IndicesOptions;
@@ -39,7 +40,11 @@ public AddIndexBlockRequest(StreamInput in) throws IOException {
3940
indices = in.readStringArray();
4041
indicesOptions = IndicesOptions.readIndicesOptions(in);
4142
block = APIBlock.readFrom(in);
42-
markVerified = in.readBoolean();
43+
if (in.getTransportVersion().onOrAfter(TransportVersions.ADD_INDEX_BLOCK_TWO_PHASE)) {
44+
markVerified = in.readBoolean();
45+
} else {
46+
markVerified = false;
47+
}
4348
}
4449

4550
/**
@@ -127,7 +132,9 @@ public void writeTo(StreamOutput out) throws IOException {
127132
out.writeStringArray(indices);
128133
indicesOptions.writeIndicesOptions(out);
129134
block.writeTo(out);
130-
out.writeBoolean(markVerified);
135+
if (out.getTransportVersion().onOrAfter(TransportVersions.ADD_INDEX_BLOCK_TWO_PHASE)) {
136+
out.writeBoolean(markVerified);
137+
}
131138
}
132139

133140
@Override

server/src/main/java/org/elasticsearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockAction.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99
package org.elasticsearch.action.admin.indices.readonly;
1010

11+
import org.elasticsearch.TransportVersions;
1112
import org.elasticsearch.action.ActionListener;
1213
import org.elasticsearch.action.ActionType;
1314
import org.elasticsearch.action.admin.indices.flush.FlushRequest;
@@ -180,7 +181,11 @@ public static final class ShardRequest extends ReplicationRequest<ShardRequest>
180181
ShardRequest(StreamInput in) throws IOException {
181182
super(in);
182183
clusterBlock = new ClusterBlock(in);
183-
phase1 = in.readBoolean();
184+
if (in.getTransportVersion().onOrAfter(TransportVersions.ADD_INDEX_BLOCK_TWO_PHASE)) {
185+
phase1 = in.readBoolean();
186+
} else {
187+
phase1 = true; // does not matter, not verified anyway
188+
}
184189
}
185190

186191
public ShardRequest(final ShardId shardId, final ClusterBlock clusterBlock, boolean phase1, final TaskId parentTaskId) {
@@ -199,7 +204,9 @@ public String toString() {
199204
public void writeTo(final StreamOutput out) throws IOException {
200205
super.writeTo(out);
201206
clusterBlock.writeTo(out);
202-
out.writeBoolean(phase1);
207+
if (out.getTransportVersion().onOrAfter(TransportVersions.ADD_INDEX_BLOCK_TWO_PHASE)) {
208+
out.writeBoolean(phase1);
209+
}
203210
}
204211

205212
public ClusterBlock clusterBlock() {

server/src/main/java/org/elasticsearch/action/admin/indices/resolve/ResolveClusterActionRequest.java

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,16 @@ public ResolveClusterActionRequest(StreamInput in) throws IOException {
8484
this.names = in.readStringArray();
8585
this.indicesOptions = IndicesOptions.readIndicesOptions(in);
8686
this.localIndicesRequested = localIndicesPresent(names);
87-
this.clusterInfoOnly = in.readBoolean();
88-
this.isQueryingCluster = in.readBoolean();
89-
this.timeout = in.readOptionalTimeValue();
87+
if (in.getTransportVersion().onOrAfter(TransportVersions.RESOLVE_CLUSTER_NO_INDEX_EXPRESSION)) {
88+
this.clusterInfoOnly = in.readBoolean();
89+
this.isQueryingCluster = in.readBoolean();
90+
} else {
91+
this.clusterInfoOnly = false;
92+
this.isQueryingCluster = false;
93+
}
94+
if (in.getTransportVersion().onOrAfter(TransportVersions.TIMEOUT_GET_PARAM_FOR_RESOLVE_CLUSTER)) {
95+
this.timeout = in.readOptionalTimeValue();
96+
}
9097
}
9198

9299
@Override
@@ -97,9 +104,13 @@ public void writeTo(StreamOutput out) throws IOException {
97104
}
98105
out.writeStringArray(names);
99106
indicesOptions.writeIndicesOptions(out);
100-
out.writeBoolean(clusterInfoOnly);
101-
out.writeBoolean(isQueryingCluster);
102-
out.writeOptionalTimeValue(timeout);
107+
if (out.getTransportVersion().onOrAfter(TransportVersions.RESOLVE_CLUSTER_NO_INDEX_EXPRESSION)) {
108+
out.writeBoolean(clusterInfoOnly);
109+
out.writeBoolean(isQueryingCluster);
110+
}
111+
if (out.getTransportVersion().onOrAfter(TransportVersions.TIMEOUT_GET_PARAM_FOR_RESOLVE_CLUSTER)) {
112+
out.writeOptionalTimeValue(timeout);
113+
}
103114
}
104115

105116
static String createVersionErrorMessage(TransportVersion versionFound) {

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ public BulkRequest(StreamInput in) throws IOException {
112112
} else {
113113
incrementalState = BulkRequest.IncrementalState.EMPTY;
114114
}
115-
includeSourceOnError = in.readBoolean();
115+
if (in.getTransportVersion().onOrAfter(TransportVersions.INGEST_REQUEST_INCLUDE_SOURCE_ON_ERROR)) {
116+
includeSourceOnError = in.readBoolean();
117+
} // else default value is true
116118
if (in.getTransportVersion().supports(STREAMS_ENDPOINT_PARAM_RESTRICTIONS)) {
117119
paramsUsed = in.readCollectionAsImmutableSet(StreamInput::readString);
118120
}
@@ -479,7 +481,9 @@ public void writeTo(StreamOutput out) throws IOException {
479481
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_16_0)) {
480482
incrementalState.writeTo(out);
481483
}
482-
out.writeBoolean(includeSourceOnError);
484+
if (out.getTransportVersion().onOrAfter(TransportVersions.INGEST_REQUEST_INCLUDE_SOURCE_ON_ERROR)) {
485+
out.writeBoolean(includeSourceOnError);
486+
}
483487
if (out.getTransportVersion().supports(STREAMS_ENDPOINT_PARAM_RESTRICTIONS)) {
484488
out.writeCollection(paramsUsed, StreamOutput::writeString);
485489
}

server/src/main/java/org/elasticsearch/action/datastreams/GetDataStreamAction.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,9 @@ public String getIndexModeName() {
339339
@Override
340340
public void writeTo(StreamOutput out) throws IOException {
341341
dataStream.writeTo(out);
342-
out.writeBoolean(failureStoreEffectivelyEnabled);
342+
if (out.getTransportVersion().onOrAfter(TransportVersions.FAILURE_STORE_ENABLED_BY_CLUSTER_SETTING)) {
343+
out.writeBoolean(failureStoreEffectivelyEnabled);
344+
}
343345
dataStreamStatus.writeTo(out);
344346
out.writeOptionalString(indexTemplate);
345347
out.writeOptionalString(ilmPolicyName);

server/src/main/java/org/elasticsearch/action/index/IndexRequest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ public IndexRequest(@Nullable ShardId shardId, StreamInput in) throws IOExceptio
227227
}
228228
}
229229

230-
includeSourceOnError = in.readBoolean();
230+
if (in.getTransportVersion().onOrAfter(TransportVersions.INGEST_REQUEST_INCLUDE_SOURCE_ON_ERROR)) {
231+
includeSourceOnError = in.readBoolean();
232+
} // else default value is true
231233

232234
if (in.getTransportVersion().supports(INDEX_REQUEST_INCLUDE_TSID)) {
233235
tsid = in.readBytesRefOrNullIfEmpty();
@@ -815,7 +817,9 @@ private void writeBody(StreamOutput out) throws IOException {
815817
out.writeBoolean(false); // obsolete originatesFromUpdateByDoc
816818
}
817819
}
818-
out.writeBoolean(includeSourceOnError);
820+
if (out.getTransportVersion().onOrAfter(TransportVersions.INGEST_REQUEST_INCLUDE_SOURCE_ON_ERROR)) {
821+
out.writeBoolean(includeSourceOnError);
822+
}
819823
if (out.getTransportVersion().supports(INDEX_REQUEST_INCLUDE_TSID)) {
820824
out.writeBytesRef(tsid);
821825
}

0 commit comments

Comments
 (0)