Skip to content

Commit 9617724

Browse files
authored
Migrate transport versions 9000007 through 9000000 (elastic#135867) (elastic#135879)
ES-12334
1 parent f968286 commit 9617724

File tree

18 files changed

+65
-51
lines changed

18 files changed

+65
-51
lines changed

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

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,19 @@ static TransportVersion def(int id) {
140140
public static final TransportVersion TIMEOUT_GET_PARAM_FOR_RESOLVE_CLUSTER = def(8_838_0_00);
141141
public static final TransportVersion INFERENCE_REQUEST_ADAPTIVE_RATE_LIMITING = def(8_839_0_00);
142142
public static final TransportVersion ML_INFERENCE_IBM_WATSONX_RERANK_ADDED = def(8_840_0_00);
143+
// TODO: add to remove_all_applicable_selector.csv
143144
public static final TransportVersion REMOVE_ALL_APPLICABLE_SELECTOR_BACKPORT_8_18 = def(8_840_0_01);
145+
// TODO: add to retry_ilm_async_action_require_error.csv
144146
public static final TransportVersion RETRY_ILM_ASYNC_ACTION_REQUIRE_ERROR_8_18 = def(8_840_0_02);
145147
public static final TransportVersion INITIAL_ELASTICSEARCH_8_19 = def(8_841_0_00);
146148
public static final TransportVersion COHERE_BIT_EMBEDDING_TYPE_SUPPORT_ADDED_BACKPORT_8_X = def(8_841_0_01);
149+
// TODO: add to remove_all_applicable_selector.csv
147150
public static final TransportVersion REMOVE_ALL_APPLICABLE_SELECTOR_BACKPORT_8_19 = def(8_841_0_02);
148151
public static final TransportVersion ESQL_RETRY_ON_SHARD_LEVEL_FAILURE_BACKPORT_8_19 = def(8_841_0_03);
149152
public static final TransportVersion ESQL_SUPPORT_PARTIAL_RESULTS_BACKPORT_8_19 = def(8_841_0_04);
150153
public static final TransportVersion VOYAGE_AI_INTEGRATION_ADDED_BACKPORT_8_X = def(8_841_0_05);
151154
public static final TransportVersion JINA_AI_EMBEDDING_TYPE_SUPPORT_ADDED_BACKPORT_8_19 = def(8_841_0_06);
155+
// TODO: add to retry_ilm_async_action_require_error.csv
152156
public static final TransportVersion RETRY_ILM_ASYNC_ACTION_REQUIRE_ERROR_8_19 = def(8_841_0_07);
153157
public static final TransportVersion INFERENCE_CONTEXT_8_X = def(8_841_0_08);
154158
public static final TransportVersion ML_INFERENCE_DEEPSEEK_8_19 = def(8_841_0_09);
@@ -172,36 +176,22 @@ static TransportVersion def(int id) {
172176
public static final TransportVersion RESCORE_VECTOR_ALLOW_ZERO_BACKPORT_8_19 = def(8_841_0_27);
173177
public static final TransportVersion INFERENCE_ADD_TIMEOUT_PUT_ENDPOINT_8_19 = def(8_841_0_28);
174178
public static final TransportVersion ESQL_REPORT_SHARD_PARTITIONING_8_19 = def(8_841_0_29);
179+
// TODO: add to esql_driver_task_description.csv
175180
public static final TransportVersion ESQL_DRIVER_TASK_DESCRIPTION_8_19 = def(8_841_0_30);
176-
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0 = def(9_000_0_00);
177-
public static final TransportVersion REMOVE_SNAPSHOT_FAILURES_90 = def(9_000_0_01);
178-
public static final TransportVersion TRANSPORT_STATS_HANDLING_TIME_REQUIRED_90 = def(9_000_0_02);
179-
public static final TransportVersion REMOVE_DESIRED_NODE_VERSION_90 = def(9_000_0_03);
180-
public static final TransportVersion ESQL_DRIVER_TASK_DESCRIPTION_90 = def(9_000_0_04);
181-
public static final TransportVersion REMOVE_ALL_APPLICABLE_SELECTOR_9_0 = def(9_000_0_05);
182-
public static final TransportVersion BYTE_SIZE_VALUE_ALWAYS_USES_BYTES_90 = def(9_000_0_06);
183-
public static final TransportVersion RETRY_ILM_ASYNC_ACTION_REQUIRE_ERROR_90 = def(9_000_0_07);
184181
public static final TransportVersion COHERE_BIT_EMBEDDING_TYPE_SUPPORT_ADDED = def(9_001_0_00);
185-
public static final TransportVersion REMOVE_SNAPSHOT_FAILURES = def(9_002_0_00);
186-
public static final TransportVersion TRANSPORT_STATS_HANDLING_TIME_REQUIRED = def(9_003_0_00);
187-
public static final TransportVersion REMOVE_DESIRED_NODE_VERSION = def(9_004_0_00);
188-
public static final TransportVersion ESQL_DRIVER_TASK_DESCRIPTION = def(9_005_0_00);
189182
public static final TransportVersion ESQL_RETRY_ON_SHARD_LEVEL_FAILURE = def(9_006_0_00);
190183
public static final TransportVersion ESQL_PROFILE_ASYNC_NANOS = def(9_007_00_0);
191184
public static final TransportVersion ESQL_LOOKUP_JOIN_SOURCE_TEXT = def(9_008_0_00);
192-
public static final TransportVersion REMOVE_ALL_APPLICABLE_SELECTOR = def(9_009_0_00);
193185
public static final TransportVersion SLM_UNHEALTHY_IF_NO_SNAPSHOT_WITHIN = def(9_010_0_00);
194186
public static final TransportVersion ESQL_SUPPORT_PARTIAL_RESULTS = def(9_011_0_00);
195187
public static final TransportVersion REMOVE_REPOSITORY_CONFLICT_MESSAGE = def(9_012_0_00);
196188
public static final TransportVersion VOYAGE_AI_INTEGRATION_ADDED = def(9_014_0_00);
197-
public static final TransportVersion BYTE_SIZE_VALUE_ALWAYS_USES_BYTES = def(9_015_0_00);
198189
public static final TransportVersion ESQL_SERIALIZE_SOURCE_FUNCTIONS_WARNINGS = def(9_016_0_00);
199190
public static final TransportVersion ESQL_DRIVER_NODE_DESCRIPTION = def(9_017_0_00);
200191
public static final TransportVersion MULTI_PROJECT = def(9_018_0_00);
201192
public static final TransportVersion JINA_AI_EMBEDDING_TYPE_SUPPORT_ADDED = def(9_020_0_00);
202193
public static final TransportVersion UNASSIGENEDINFO_RESHARD_ADDED = def(9_022_0_00);
203194
public static final TransportVersion MAX_OPERATION_SIZE_REJECTIONS_ADDED = def(9_024_0_00);
204-
public static final TransportVersion RETRY_ILM_ASYNC_ACTION_REQUIRE_ERROR = def(9_025_0_00);
205195
public static final TransportVersion ESQL_SERIALIZE_BLOCK_TYPE_CODE = def(9_026_0_00);
206196
public static final TransportVersion ESQL_THREAD_NAME_IN_DRIVER_PROFILE = def(9_027_0_00);
207197
public static final TransportVersion INFERENCE_CONTEXT = def(9_028_0_00);

server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java

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

1010
package org.elasticsearch.action.admin.cluster.snapshots.get;
1111

12-
import org.elasticsearch.TransportVersions;
12+
import org.elasticsearch.TransportVersion;
1313
import org.elasticsearch.action.ActionResponse;
1414
import org.elasticsearch.common.Strings;
1515
import org.elasticsearch.common.collect.Iterators;
@@ -31,6 +31,8 @@
3131
*/
3232
public class GetSnapshotsResponse extends ActionResponse implements ChunkedToXContentObject {
3333

34+
private static final TransportVersion REMOVE_SNAPSHOT_FAILURES = TransportVersion.fromName("remove_snapshot_failures");
35+
3436
private final List<SnapshotInfo> snapshots;
3537

3638
@Nullable
@@ -49,8 +51,7 @@ public GetSnapshotsResponse(List<SnapshotInfo> snapshots, @Nullable String next,
4951

5052
public GetSnapshotsResponse(StreamInput in) throws IOException {
5153
this.snapshots = in.readCollectionAsImmutableList(SnapshotInfo::readFrom);
52-
if (in.getTransportVersion().before(TransportVersions.REMOVE_SNAPSHOT_FAILURES)
53-
&& in.getTransportVersion().isPatchFrom(TransportVersions.REMOVE_SNAPSHOT_FAILURES_90) == false) {
54+
if (in.getTransportVersion().supports(REMOVE_SNAPSHOT_FAILURES) == false) {
5455
// Deprecated `failures` field
5556
in.readMap(StreamInput::readException);
5657
}
@@ -84,8 +85,7 @@ public int remaining() {
8485
@Override
8586
public void writeTo(StreamOutput out) throws IOException {
8687
out.writeCollection(snapshots);
87-
if (out.getTransportVersion().before(TransportVersions.REMOVE_SNAPSHOT_FAILURES)
88-
&& out.getTransportVersion().isPatchFrom(TransportVersions.REMOVE_SNAPSHOT_FAILURES_90) == false) {
88+
if (out.getTransportVersion().supports(REMOVE_SNAPSHOT_FAILURES) == false) {
8989
// Deprecated `failures` field
9090
out.writeMap(Map.of(), StreamOutput::writeException);
9191
}

server/src/main/java/org/elasticsearch/action/support/IndexComponentSelector.java

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

1010
package org.elasticsearch.action.support;
1111

12+
import org.elasticsearch.TransportVersion;
1213
import org.elasticsearch.TransportVersions;
1314
import org.elasticsearch.common.io.stream.StreamInput;
1415
import org.elasticsearch.common.io.stream.StreamOutput;
@@ -30,6 +31,8 @@ public enum IndexComponentSelector implements Writeable {
3031
DATA("data", (byte) 0),
3132
FAILURES("failures", (byte) 1);
3233

34+
private static final TransportVersion REMOVE_ALL_APPLICABLE_SELECTOR = TransportVersion.fromName("remove_all_applicable_selector");
35+
3336
private final String key;
3437
private final byte id;
3538

@@ -92,8 +95,7 @@ public static IndexComponentSelector getByKeyOrThrow(@Nullable String key) {
9295

9396
public static IndexComponentSelector read(StreamInput in) throws IOException {
9497
byte id = in.readByte();
95-
if (in.getTransportVersion().onOrAfter(TransportVersions.REMOVE_ALL_APPLICABLE_SELECTOR)
96-
|| in.getTransportVersion().isPatchFrom(TransportVersions.REMOVE_ALL_APPLICABLE_SELECTOR_9_0)
98+
if (in.getTransportVersion().supports(REMOVE_ALL_APPLICABLE_SELECTOR)
9799
|| in.getTransportVersion().isPatchFrom(TransportVersions.REMOVE_ALL_APPLICABLE_SELECTOR_BACKPORT_8_18)
98100
|| in.getTransportVersion().isPatchFrom(TransportVersions.REMOVE_ALL_APPLICABLE_SELECTOR_BACKPORT_8_19)) {
99101
return getById(id);

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
public final class DesiredNode implements Writeable, ToXContentObject, Comparable<DesiredNode> {
4343

4444
public static final TransportVersion RANGE_FLOAT_PROCESSORS_SUPPORT_TRANSPORT_VERSION = TransportVersions.V_8_3_0;
45+
private static final TransportVersion REMOVE_DESIRED_NODE_VERSION = TransportVersion.fromName("remove_desired_node_version");
4546

4647
private static final ParseField SETTINGS_FIELD = new ParseField("settings");
4748
private static final ParseField PROCESSORS_FIELD = new ParseField("processors");
@@ -161,8 +162,7 @@ public static DesiredNode readFrom(StreamInput in) throws IOException {
161162
}
162163
final var memory = ByteSizeValue.readFrom(in);
163164
final var storage = ByteSizeValue.readFrom(in);
164-
if (in.getTransportVersion().before(TransportVersions.REMOVE_DESIRED_NODE_VERSION)
165-
&& in.getTransportVersion().isPatchFrom(TransportVersions.REMOVE_DESIRED_NODE_VERSION_90) == false) {
165+
if (in.getTransportVersion().supports(REMOVE_DESIRED_NODE_VERSION) == false) {
166166
in.readOptionalString();
167167
}
168168
return new DesiredNode(settings, processors, processorsRange, memory, storage);
@@ -181,8 +181,7 @@ public void writeTo(StreamOutput out) throws IOException {
181181
}
182182
memory.writeTo(out);
183183
storage.writeTo(out);
184-
if (out.getTransportVersion().before(TransportVersions.REMOVE_DESIRED_NODE_VERSION)
185-
&& out.getTransportVersion().isPatchFrom(TransportVersions.REMOVE_DESIRED_NODE_VERSION_90) == false) {
184+
if (out.getTransportVersion().supports(REMOVE_DESIRED_NODE_VERSION) == false) {
186185
out.writeOptionalString(null);
187186
}
188187
}

server/src/main/java/org/elasticsearch/common/unit/ByteSizeValue.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
import java.util.Locale;
2626
import java.util.Objects;
2727

28-
import static org.elasticsearch.TransportVersions.BYTE_SIZE_VALUE_ALWAYS_USES_BYTES;
2928
import static org.elasticsearch.TransportVersions.BYTE_SIZE_VALUE_ALWAYS_USES_BYTES_1;
30-
import static org.elasticsearch.TransportVersions.BYTE_SIZE_VALUE_ALWAYS_USES_BYTES_90;
3129
import static org.elasticsearch.TransportVersions.REVERT_BYTE_SIZE_VALUE_ALWAYS_USES_BYTES_1;
3230
import static org.elasticsearch.common.unit.ByteSizeUnit.BYTES;
3331
import static org.elasticsearch.common.unit.ByteSizeUnit.GB;
@@ -51,6 +49,10 @@ static class DeprecationLoggerHolder {
5149
public static final ByteSizeValue ONE = new ByteSizeValue(1, BYTES);
5250
public static final ByteSizeValue MINUS_ONE = new ByteSizeValue(-1, BYTES);
5351

52+
private static final TransportVersion BYTE_SIZE_VALUE_ALWAYS_USES_BYTES = TransportVersion.fromName(
53+
"byte_size_value_always_uses_bytes"
54+
);
55+
5456
/**
5557
* @param size the number of {@code unit}s
5658
*/
@@ -133,8 +135,7 @@ public void writeTo(StreamOutput out) throws IOException {
133135
}
134136

135137
private static boolean alwaysUseBytes(TransportVersion tv) {
136-
return tv.onOrAfter(BYTE_SIZE_VALUE_ALWAYS_USES_BYTES)
137-
|| tv.isPatchFrom(BYTE_SIZE_VALUE_ALWAYS_USES_BYTES_90)
138+
return tv.supports(BYTE_SIZE_VALUE_ALWAYS_USES_BYTES)
138139
|| tv.between(BYTE_SIZE_VALUE_ALWAYS_USES_BYTES_1, REVERT_BYTE_SIZE_VALUE_ALWAYS_USES_BYTES_1);
139140
}
140141

server/src/main/java/org/elasticsearch/transport/TransportStats.java

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

1010
package org.elasticsearch.transport;
1111

12+
import org.elasticsearch.TransportVersion;
1213
import org.elasticsearch.TransportVersions;
1314
import org.elasticsearch.common.collect.Iterators;
1415
import org.elasticsearch.common.io.stream.StreamInput;
@@ -29,6 +30,10 @@
2930

3031
public class TransportStats implements Writeable, ChunkedToXContent {
3132

33+
private static final TransportVersion TRANSPORT_STATS_HANDLING_TIME_REQUIRED = TransportVersion.fromName(
34+
"transport_stats_handling_time_required"
35+
);
36+
3237
private final long serverOpen;
3338
private final long totalOutboundConnections;
3439
private final long rxCount;
@@ -69,8 +74,7 @@ public TransportStats(StreamInput in) throws IOException {
6974
rxSize = in.readVLong();
7075
txCount = in.readVLong();
7176
txSize = in.readVLong();
72-
if (in.getTransportVersion().before(TransportVersions.TRANSPORT_STATS_HANDLING_TIME_REQUIRED)
73-
&& in.getTransportVersion().isPatchFrom(TransportVersions.TRANSPORT_STATS_HANDLING_TIME_REQUIRED_90) == false) {
77+
if (in.getTransportVersion().supports(TRANSPORT_STATS_HANDLING_TIME_REQUIRED) == false) {
7478
in.readBoolean();
7579
}
7680
inboundHandlingTimeBucketFrequencies = new long[HandlingTimeTracker.BUCKET_COUNT];
@@ -99,8 +103,7 @@ public void writeTo(StreamOutput out) throws IOException {
99103
out.writeVLong(txSize);
100104
assert inboundHandlingTimeBucketFrequencies.length == HandlingTimeTracker.BUCKET_COUNT;
101105
assert outboundHandlingTimeBucketFrequencies.length == HandlingTimeTracker.BUCKET_COUNT;
102-
if (out.getTransportVersion().before(TransportVersions.TRANSPORT_STATS_HANDLING_TIME_REQUIRED)
103-
&& out.getTransportVersion().isPatchFrom(TransportVersions.TRANSPORT_STATS_HANDLING_TIME_REQUIRED_90) == false) {
106+
if (out.getTransportVersion().supports(TRANSPORT_STATS_HANDLING_TIME_REQUIRED) == false) {
104107
out.writeBoolean(true);
105108
}
106109
for (long handlingTimeBucketFrequency : inboundHandlingTimeBucketFrequencies) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9015000,9000006
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9005000,9000004
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9009000,9000005
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9004000,9000003

0 commit comments

Comments
 (0)