Skip to content

Commit a27b6ea

Browse files
authored
Migrate transport versions 9162_000 through 9158_000 (#135806)
ES-12334
1 parent 5d3a59d commit a27b6ea

File tree

21 files changed

+65
-40
lines changed

21 files changed

+65
-40
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,6 @@ static TransportVersion def(int id) {
260260
public static final TransportVersion STATE_PARAM_GET_SNAPSHOT = def(9_100_0_00);
261261
public static final TransportVersion PROJECT_ID_IN_SNAPSHOTS_DELETIONS_AND_REPO_CLEANUP = def(9_101_0_00);
262262
public static final TransportVersion CLUSTER_STATE_PROJECTS_SETTINGS = def(9_108_0_00);
263-
public static final TransportVersion INDEX_SOURCE = def(9_158_0_00);
264-
public static final TransportVersion MAX_HEAP_SIZE_PER_NODE_IN_CLUSTER_INFO = def(9_159_0_00);
265-
public static final TransportVersion TIMESERIES_DEFAULT_LIMIT = def(9_160_0_00);
266-
public static final TransportVersion INFERENCE_API_OPENAI_HEADERS = def(9_161_0_00);
267-
public static final TransportVersion NEW_SEMANTIC_QUERY_INTERCEPTORS = def(9_162_0_00);
268263

269264
/*
270265
* STOP! READ THIS FIRST! No, really,

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@
7575
public class IndexRequest extends ReplicatedWriteRequest<IndexRequest> implements DocWriteRequest<IndexRequest>, CompositeIndicesRequest {
7676

7777
private static final long SHALLOW_SIZE = RamUsageEstimator.shallowSizeOfInstance(IndexRequest.class);
78+
7879
private static final TransportVersion PIPELINES_HAVE_RUN_FIELD_ADDED = TransportVersions.V_8_10_X;
7980
private static final TransportVersion INDEX_REQUEST_INCLUDE_TSID = TransportVersion.fromName("index_request_include_tsid");
81+
private static final TransportVersion INDEX_SOURCE = TransportVersion.fromName("index_source");
8082

8183
private static final Supplier<String> ID_GENERATOR = UUIDs::base64UUID;
8284

@@ -164,7 +166,7 @@ public IndexRequest(@Nullable ShardId shardId, StreamInput in) throws IOExceptio
164166
}
165167
id = in.readOptionalString();
166168
routing = in.readOptionalString();
167-
boolean beforeSourceContext = in.getTransportVersion().before(TransportVersions.INDEX_SOURCE);
169+
boolean beforeSourceContext = in.getTransportVersion().supports(INDEX_SOURCE) == false;
168170
BytesReference source;
169171
IndexSource localIndexSource = null;
170172
if (beforeSourceContext) {
@@ -765,7 +767,7 @@ private void writeBody(StreamOutput out) throws IOException {
765767
}
766768
out.writeOptionalString(id);
767769
out.writeOptionalString(routing);
768-
if (out.getTransportVersion().onOrAfter(TransportVersions.INDEX_SOURCE)) {
770+
if (out.getTransportVersion().supports(INDEX_SOURCE)) {
769771
indexSource.writeTo(out);
770772
} else {
771773
out.writeBytesReference(indexSource.bytes());
@@ -778,7 +780,7 @@ private void writeBody(StreamOutput out) throws IOException {
778780
out.writeBoolean(isPipelineResolved);
779781
out.writeBoolean(isRetry);
780782
out.writeLong(autoGeneratedTimestamp);
781-
if (out.getTransportVersion().before(TransportVersions.INDEX_SOURCE)) {
783+
if (out.getTransportVersion().supports(INDEX_SOURCE) == false) {
782784
XContentType contentType = indexSource.contentType();
783785
if (contentType != null) {
784786
out.writeBoolean(true);

server/src/main/java/org/elasticsearch/cluster/ClusterInfo.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public class ClusterInfo implements ChunkedToXContent, Writeable, ExpectedShardS
5454
"node_usage_stats_for_thread_pools_in_cluster_info"
5555
);
5656
private static final TransportVersion SHARD_WRITE_LOAD_IN_CLUSTER_INFO = TransportVersion.fromName("shard_write_load_in_cluster_info");
57+
private static final TransportVersion MAX_HEAP_SIZE_PER_NODE_IN_CLUSTER_INFO = TransportVersion.fromName(
58+
"max_heap_size_per_node_in_cluster_info"
59+
);
5760

5861
private final Map<String, DiskUsage> leastAvailableSpaceUsage;
5962
private final Map<String, DiskUsage> mostAvailableSpaceUsage;
@@ -131,7 +134,7 @@ public ClusterInfo(StreamInput in) throws IOException {
131134
} else {
132135
this.shardWriteLoads = Map.of();
133136
}
134-
if (in.getTransportVersion().onOrAfter(TransportVersions.MAX_HEAP_SIZE_PER_NODE_IN_CLUSTER_INFO)) {
137+
if (in.getTransportVersion().supports(MAX_HEAP_SIZE_PER_NODE_IN_CLUSTER_INFO)) {
135138
this.maxHeapSizePerNode = in.readImmutableMap(ByteSizeValue::readFrom);
136139
} else {
137140
this.maxHeapSizePerNode = Map.of();
@@ -155,7 +158,7 @@ public void writeTo(StreamOutput out) throws IOException {
155158
if (out.getTransportVersion().supports(SHARD_WRITE_LOAD_IN_CLUSTER_INFO)) {
156159
out.writeMap(this.shardWriteLoads, StreamOutput::writeWriteable, StreamOutput::writeDouble);
157160
}
158-
if (out.getTransportVersion().onOrAfter(TransportVersions.MAX_HEAP_SIZE_PER_NODE_IN_CLUSTER_INFO)) {
161+
if (out.getTransportVersion().supports(MAX_HEAP_SIZE_PER_NODE_IN_CLUSTER_INFO)) {
159162
out.writeMap(this.maxHeapSizePerNode, StreamOutput::writeWriteable);
160163
}
161164
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9158000
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9161000
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9159000
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9162000
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9160000

server/src/test/java/org/elasticsearch/TransportVersionTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ public void testTransportVersionsLocked() {
419419
"TransportVersions.java is locked. Generate transport versions with TransportVersion.fromName "
420420
+ "and generateTransportVersion gradle task",
421421
TransportVersions.DEFINED_VERSIONS.getLast().id(),
422-
equalTo(9_162_0_00)
422+
equalTo(9_108_0_00)
423423
);
424424
}
425425
}

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type/DataType.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import java.util.stream.Collectors;
3434

3535
import static java.util.stream.Collectors.toMap;
36-
import static org.elasticsearch.TransportVersions.INDEX_SOURCE;
3736

3837
/**
3938
* This enum represents data types the ES|QL query processing layer is able to
@@ -297,9 +296,9 @@ public enum DataType implements Writeable {
297296
// NOTE: If INDEX_SOURCE somehow gets backported to a version that doesn't actually support these types, we'll be missing validation for
298297
// mixed/multi clusters with remotes that don't support these types. This is low-ish risk because these types require specific
299298
// geo functions to turn up in the query, and those types aren't available before 9.2.0 either.
300-
GEOHASH(builder().esType("geohash").typeName("GEOHASH").estimatedSize(Long.BYTES).supportedOn(INDEX_SOURCE)),
301-
GEOTILE(builder().esType("geotile").typeName("GEOTILE").estimatedSize(Long.BYTES).supportedOn(INDEX_SOURCE)),
302-
GEOHEX(builder().esType("geohex").typeName("GEOHEX").estimatedSize(Long.BYTES).supportedOn(INDEX_SOURCE)),
299+
GEOHASH(builder().esType("geohash").typeName("GEOHASH").estimatedSize(Long.BYTES).supportedOn(DataTypesTransportVersions.INDEX_SOURCE)),
300+
GEOTILE(builder().esType("geotile").typeName("GEOTILE").estimatedSize(Long.BYTES).supportedOn(DataTypesTransportVersions.INDEX_SOURCE)),
301+
GEOHEX(builder().esType("geohex").typeName("GEOHEX").estimatedSize(Long.BYTES).supportedOn(DataTypesTransportVersions.INDEX_SOURCE)),
303302

304303
/**
305304
* Fields with this type represent a Lucene doc id. This field is a bit magic in that:
@@ -322,7 +321,9 @@ public enum DataType implements Writeable {
322321
// NOTE: If INDEX_SOURCE somehow gets backported to a version that doesn't actually support _tsid, we'll be missing validation for
323322
// mixed/multi clusters with remotes that don't support these types. This is low-ish risk because _tsid requires specifically being
324323
// used in `FROM idx METADATA _tsid` or in the `TS` command, which both weren't available before 9.2.0.
325-
TSID_DATA_TYPE(builder().esType("_tsid").estimatedSize(Long.BYTES * 2).docValues().supportedOn(INDEX_SOURCE)),
324+
TSID_DATA_TYPE(
325+
builder().esType("_tsid").estimatedSize(Long.BYTES * 2).docValues().supportedOn(DataTypesTransportVersions.INDEX_SOURCE)
326+
),
326327
/**
327328
* Fields with this type are the partial result of running a non-time-series aggregation
328329
* inside alongside time-series aggregations. These fields are not parsable from the
@@ -971,6 +972,9 @@ Builder underConstruction() {
971972
}
972973

973974
private static class DataTypesTransportVersions {
975+
976+
public static final TransportVersion INDEX_SOURCE = TransportVersion.fromName("index_source");
977+
974978
public static final TransportVersion ESQL_DENSE_VECTOR_CREATED_VERSION = TransportVersion.fromName(
975979
"esql_dense_vector_created_version"
976980
);

0 commit comments

Comments
 (0)