Skip to content

Commit 0dda109

Browse files
authored
Remove 7.16 transport version (#124194)
1 parent 5948b71 commit 0dda109

File tree

14 files changed

+21
-119
lines changed

14 files changed

+21
-119
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1842,7 +1842,7 @@ private enum ElasticsearchExceptionHandle {
18421842
org.elasticsearch.ElasticsearchAuthenticationProcessingError.class,
18431843
org.elasticsearch.ElasticsearchAuthenticationProcessingError::new,
18441844
162,
1845-
TransportVersions.V_7_16_0
1845+
UNKNOWN_VERSION_ADDED
18461846
),
18471847
REPOSITORY_CONFLICT_EXCEPTION(
18481848
org.elasticsearch.repositories.RepositoryConflictException.class,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ static TransportVersion def(int id) {
6262
public static final TransportVersion V_7_10_0 = def(7_10_00_99);
6363
public static final TransportVersion V_7_15_0 = def(7_15_00_99);
6464
public static final TransportVersion V_7_15_1 = def(7_15_01_99);
65-
public static final TransportVersion V_7_16_0 = def(7_16_00_99);
6665
public static final TransportVersion V_7_17_0 = def(7_17_00_99);
6766
public static final TransportVersion V_7_17_1 = def(7_17_01_99);
6867
public static final TransportVersion V_7_17_8 = def(7_17_08_99);

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

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

1010
package org.elasticsearch.cluster.metadata;
1111

12-
import org.elasticsearch.TransportVersion;
1312
import org.elasticsearch.TransportVersions;
1413
import org.elasticsearch.cluster.routing.allocation.ShardAllocationDecision;
1514
import org.elasticsearch.common.Strings;
@@ -33,7 +32,6 @@
3332
import static org.elasticsearch.common.xcontent.ChunkedToXContentHelper.startObject;
3433

3534
public class ShutdownShardMigrationStatus implements Writeable, ChunkedToXContentObject {
36-
private static final TransportVersion ALLOCATION_DECISION_ADDED_VERSION = TransportVersions.V_7_16_0;
3735

3836
public static final String NODE_ALLOCATION_DECISION_KEY = "node_allocation_decision";
3937

@@ -142,11 +140,7 @@ public ShutdownShardMigrationStatus(StreamInput in) throws IOException {
142140
this.shardsRemaining = in.readLong();
143141
}
144142
this.explanation = in.readOptionalString();
145-
if (in.getTransportVersion().onOrAfter(ALLOCATION_DECISION_ADDED_VERSION)) {
146-
this.allocationDecision = in.readOptionalWriteable(ShardAllocationDecision::new);
147-
} else {
148-
this.allocationDecision = null;
149-
}
143+
this.allocationDecision = in.readOptionalWriteable(ShardAllocationDecision::new);
150144
}
151145

152146
public long getShardsRemaining() {
@@ -203,9 +197,7 @@ public void writeTo(StreamOutput out) throws IOException {
203197
out.writeLong(shardsRemaining);
204198
}
205199
out.writeOptionalString(explanation);
206-
if (out.getTransportVersion().onOrAfter(ALLOCATION_DECISION_ADDED_VERSION)) {
207-
out.writeOptionalWriteable(allocationDecision);
208-
}
200+
out.writeOptionalWriteable(allocationDecision);
209201
}
210202

211203
@Override

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

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
*/
3737
public class SingleNodeShutdownMetadata implements SimpleDiffable<SingleNodeShutdownMetadata>, ToXContentObject {
3838

39-
public static final TransportVersion REPLACE_SHUTDOWN_TYPE_ADDED_VERSION = TransportVersions.V_7_16_0;
4039
public static final TransportVersion SIGTERM_ADDED_VERSION = TransportVersions.V_8_9_X;
4140
public static final TransportVersion GRACE_PERIOD_ADDED_VERSION = TransportVersions.V_8_9_X;
4241

@@ -180,11 +179,7 @@ public SingleNodeShutdownMetadata(StreamInput in) throws IOException {
180179
this.startedAtMillis = in.readVLong();
181180
this.nodeSeen = in.readBoolean();
182181
this.allocationDelay = in.readOptionalTimeValue();
183-
if (in.getTransportVersion().onOrAfter(REPLACE_SHUTDOWN_TYPE_ADDED_VERSION)) {
184-
this.targetNodeName = in.readOptionalString();
185-
} else {
186-
this.targetNodeName = null;
187-
}
182+
this.targetNodeName = in.readOptionalString();
188183
if (in.getTransportVersion().onOrAfter(GRACE_PERIOD_ADDED_VERSION)) {
189184
this.gracePeriod = in.readOptionalTimeValue();
190185
} else {
@@ -271,8 +266,7 @@ public void writeTo(StreamOutput out) throws IOException {
271266
if (out.getTransportVersion().onOrAfter(NODE_SHUTDOWN_EPHEMERAL_ID_ADDED)) {
272267
out.writeOptionalString(nodeEphemeralId);
273268
}
274-
if ((out.getTransportVersion().before(REPLACE_SHUTDOWN_TYPE_ADDED_VERSION) && this.type == SingleNodeShutdownMetadata.Type.REPLACE)
275-
|| (out.getTransportVersion().before(SIGTERM_ADDED_VERSION) && this.type == Type.SIGTERM)) {
269+
if (out.getTransportVersion().before(SIGTERM_ADDED_VERSION) && this.type == Type.SIGTERM) {
276270
out.writeEnum(SingleNodeShutdownMetadata.Type.REMOVE);
277271
} else {
278272
out.writeEnum(type);
@@ -281,9 +275,7 @@ public void writeTo(StreamOutput out) throws IOException {
281275
out.writeVLong(startedAtMillis);
282276
out.writeBoolean(nodeSeen);
283277
out.writeOptionalTimeValue(allocationDelay);
284-
if (out.getTransportVersion().onOrAfter(REPLACE_SHUTDOWN_TYPE_ADDED_VERSION)) {
285-
out.writeOptionalString(targetNodeName);
286-
}
278+
out.writeOptionalString(targetNodeName);
287279
if (out.getTransportVersion().onOrAfter(GRACE_PERIOD_ADDED_VERSION)) {
288280
out.writeOptionalTimeValue(gracePeriod);
289281
}

server/src/main/java/org/elasticsearch/cluster/service/ClusterStateUpdateStats.java

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

1010
package org.elasticsearch.cluster.service;
1111

12-
import org.elasticsearch.TransportVersions;
1312
import org.elasticsearch.common.io.stream.StreamInput;
1413
import org.elasticsearch.common.io.stream.StreamOutput;
1514
import org.elasticsearch.common.io.stream.Writeable;
@@ -118,7 +117,6 @@ public ClusterStateUpdateStats(StreamInput in) throws IOException {
118117

119118
@Override
120119
public void writeTo(StreamOutput out) throws IOException {
121-
assert out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0) : out.getTransportVersion();
122120
out.writeVLong(unchangedTaskCount);
123121
out.writeVLong(publicationSuccessCount);
124122
out.writeVLong(publicationFailureCount);

server/src/main/java/org/elasticsearch/common/document/DocumentField.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ public class DocumentField implements Writeable, Iterable<Object> {
4545
public DocumentField(StreamInput in) throws IOException {
4646
name = in.readString();
4747
values = in.readCollectionAsList(StreamInput::readGenericValue);
48-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) {
49-
ignoredValues = in.readCollectionAsList(StreamInput::readGenericValue);
50-
} else {
51-
ignoredValues = Collections.emptyList();
52-
}
48+
ignoredValues = in.readCollectionAsList(StreamInput::readGenericValue);
5349
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) {
5450
lookupFields = in.readCollectionAsList(LookupField::new);
5551
} else {
@@ -115,9 +111,7 @@ public List<Object> getIgnoredValues() {
115111
public void writeTo(StreamOutput out) throws IOException {
116112
out.writeString(name);
117113
out.writeCollection(values, StreamOutput::writeGenericValue);
118-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) {
119-
out.writeCollection(ignoredValues, StreamOutput::writeGenericValue);
120-
}
114+
out.writeCollection(ignoredValues, StreamOutput::writeGenericValue);
121115
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) {
122116
out.writeCollection(lookupFields);
123117
} else {

server/src/main/java/org/elasticsearch/discovery/DiscoveryStats.java

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

1010
package org.elasticsearch.discovery;
1111

12-
import org.elasticsearch.TransportVersions;
1312
import org.elasticsearch.cluster.coordination.PendingClusterStateStats;
1413
import org.elasticsearch.cluster.coordination.PublishClusterStateStats;
1514
import org.elasticsearch.cluster.service.ClusterApplierRecordingService;
@@ -44,28 +43,16 @@ public DiscoveryStats(
4443
public DiscoveryStats(StreamInput in) throws IOException {
4544
queueStats = in.readOptionalWriteable(PendingClusterStateStats::new);
4645
publishStats = in.readOptionalWriteable(PublishClusterStateStats::new);
47-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) {
48-
clusterStateUpdateStats = in.readOptionalWriteable(ClusterStateUpdateStats::new);
49-
} else {
50-
clusterStateUpdateStats = null;
51-
}
52-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) {
53-
applierRecordingStats = in.readOptionalWriteable(ClusterApplierRecordingService.Stats::new);
54-
} else {
55-
applierRecordingStats = null;
56-
}
46+
clusterStateUpdateStats = in.readOptionalWriteable(ClusterStateUpdateStats::new);
47+
applierRecordingStats = in.readOptionalWriteable(ClusterApplierRecordingService.Stats::new);
5748
}
5849

5950
@Override
6051
public void writeTo(StreamOutput out) throws IOException {
6152
out.writeOptionalWriteable(queueStats);
6253
out.writeOptionalWriteable(publishStats);
63-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) {
64-
out.writeOptionalWriteable(clusterStateUpdateStats);
65-
}
66-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) {
67-
out.writeOptionalWriteable(applierRecordingStats);
68-
}
54+
out.writeOptionalWriteable(clusterStateUpdateStats);
55+
out.writeOptionalWriteable(applierRecordingStats);
6956
}
7057

7158
@Override

server/src/main/java/org/elasticsearch/index/store/StoreFileMetadata.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
import org.apache.lucene.index.SegmentInfos;
1717
import org.apache.lucene.util.BytesRef;
1818
import org.apache.lucene.util.Version;
19-
import org.elasticsearch.TransportVersion;
20-
import org.elasticsearch.TransportVersions;
2119
import org.elasticsearch.common.io.stream.StreamInput;
2220
import org.elasticsearch.common.io.stream.StreamOutput;
2321
import org.elasticsearch.common.io.stream.Writeable;
@@ -31,7 +29,6 @@
3129
public class StoreFileMetadata implements Writeable {
3230

3331
public static final BytesRef UNAVAILABLE_WRITER_UUID = new BytesRef();
34-
private static final TransportVersion WRITER_UUID_MIN_VERSION = TransportVersions.V_7_16_0;
3532

3633
private final String name;
3734

@@ -71,11 +68,7 @@ public StoreFileMetadata(StreamInput in) throws IOException {
7168
checksum = in.readString();
7269
writtenBy = in.readString();
7370
hash = in.readBytesRef();
74-
if (in.getTransportVersion().onOrAfter(WRITER_UUID_MIN_VERSION)) {
75-
writerUuid = StoreFileMetadata.toWriterUuid(in.readBytesRef());
76-
} else {
77-
writerUuid = UNAVAILABLE_WRITER_UUID;
78-
}
71+
writerUuid = StoreFileMetadata.toWriterUuid(in.readBytesRef());
7972
}
8073

8174
@Override
@@ -85,9 +78,7 @@ public void writeTo(StreamOutput out) throws IOException {
8578
out.writeString(checksum);
8679
out.writeString(writtenBy);
8780
out.writeBytesRef(hash);
88-
if (out.getTransportVersion().onOrAfter(WRITER_UUID_MIN_VERSION)) {
89-
out.writeBytesRef(writerUuid);
90-
}
81+
out.writeBytesRef(writerUuid);
9182
}
9283

9384
/**
@@ -196,7 +187,6 @@ public BytesRef hash() {
196187
* This ID may be {@link StoreFileMetadata#UNAVAILABLE_WRITER_UUID} (i.e. zero-length) if unavailable, e.g.:
197188
*
198189
* - The file was written by a version of Lucene prior to 8.6.0.
199-
* - The metadata came from a version of Elasticsearch prior to {@link StoreFileMetadata#WRITER_UUID_MIN_VERSION}).
200190
* - The file is not one of the files listed above.
201191
*
202192
*/

server/src/main/java/org/elasticsearch/indices/recovery/RecoverySettings.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public class RecoverySettings {
5252
public static final IndexVersion SNAPSHOT_RECOVERIES_SUPPORTED_INDEX_VERSION = IndexVersions.V_7_15_0;
5353
public static final TransportVersion SNAPSHOT_RECOVERIES_SUPPORTED_TRANSPORT_VERSION = TransportVersions.V_7_15_0;
5454
public static final IndexVersion SEQ_NO_SNAPSHOT_RECOVERIES_SUPPORTED_VERSION = IndexVersions.V_7_16_0;
55-
public static final TransportVersion SNAPSHOT_FILE_DOWNLOAD_THROTTLING_SUPPORTED_TRANSPORT_VERSION = TransportVersions.V_7_16_0;
5655

5756
private static final Logger logger = LogManager.getLogger(RecoverySettings.class);
5857

server/src/main/java/org/elasticsearch/indices/recovery/StartRecoveryRequest.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ public StartRecoveryRequest(StreamInput in) throws IOException {
5252
metadataSnapshot = Store.MetadataSnapshot.readFrom(in);
5353
primaryRelocation = in.readBoolean();
5454
startingSeqNo = in.readLong();
55-
if (in.getTransportVersion().onOrAfter(RecoverySettings.SNAPSHOT_FILE_DOWNLOAD_THROTTLING_SUPPORTED_TRANSPORT_VERSION)) {
56-
canDownloadSnapshotFiles = in.readBoolean();
57-
} else {
58-
canDownloadSnapshotFiles = true;
59-
}
55+
canDownloadSnapshotFiles = in.readBoolean();
6056
}
6157

6258
/**
@@ -171,9 +167,7 @@ public void writeTo(StreamOutput out) throws IOException {
171167
metadataSnapshot.writeTo(out);
172168
out.writeBoolean(primaryRelocation);
173169
out.writeLong(startingSeqNo);
174-
if (out.getTransportVersion().onOrAfter(RecoverySettings.SNAPSHOT_FILE_DOWNLOAD_THROTTLING_SUPPORTED_TRANSPORT_VERSION)) {
175-
out.writeBoolean(canDownloadSnapshotFiles);
176-
}
170+
out.writeBoolean(canDownloadSnapshotFiles);
177171
}
178172

179173
@Override

0 commit comments

Comments
 (0)