Skip to content

Commit 0a4ec40

Browse files
authored
Remove V8_10_X transport version (elastic#139157)
1 parent c2b0172 commit 0a4ec40

File tree

48 files changed

+173
-990
lines changed

Some content is hidden

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

48 files changed

+173
-990
lines changed

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

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -231,18 +231,9 @@ public static Build readBuild(StreamInput in) throws IOException {
231231
version = versionMatcher.group(1);
232232
qualifier = versionMatcher.group(2);
233233
}
234-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_10_X)) {
235-
minWireVersion = in.readString();
236-
minIndexVersion = in.readString();
237-
displayString = in.readString();
238-
} else {
239-
// the version is qualified, so we may need to strip off -SNAPSHOT or -alpha, etc. Here we simply find the first dash
240-
int dashNdx = version.indexOf('-');
241-
var versionConstant = Version.fromString(dashNdx == -1 ? version : version.substring(0, dashNdx));
242-
minWireVersion = versionConstant.minimumCompatibilityVersion().toString();
243-
minIndexVersion = minimumCompatString(IndexVersion.getMinimumCompatibleIndexVersion(versionConstant.id()));
244-
displayString = defaultDisplayString(type, hash, date, qualifiedVersionString(version, qualifier, snapshot));
245-
}
234+
minWireVersion = in.readString();
235+
minIndexVersion = in.readString();
236+
displayString = in.readString();
246237
return new Build(flavor, type, hash, date, version, qualifier, snapshot, minWireVersion, minIndexVersion, displayString);
247238
}
248239

@@ -259,11 +250,9 @@ public static void writeBuild(Build build, StreamOutput out) throws IOException
259250
out.writeBoolean(build.isSnapshot());
260251
out.writeString(build.qualifiedVersion());
261252
}
262-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_10_X)) {
263-
out.writeString(build.minWireCompatVersion());
264-
out.writeString(build.minIndexCompatVersion());
265-
out.writeString(build.displayString());
266-
}
253+
out.writeString(build.minWireCompatVersion());
254+
out.writeString(build.minIndexCompatVersion());
255+
out.writeString(build.displayString());
267256
}
268257

269258
/**

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ static TransportVersion def(int id) {
5757
* READ THE COMMENT BELOW THIS BLOCK OF DECLARATIONS BEFORE ADDING NEW TRANSPORT VERSIONS
5858
* Detached transport versions added below here.
5959
*/
60-
public static final TransportVersion V_8_10_X = def(8_500_0_61);
6160
public static final TransportVersion V_8_11_X = def(8_512_0_01);
6261
public static final TransportVersion V_8_12_0 = def(8_560_0_00);
6362
public static final TransportVersion V_8_12_1 = def(8_560_0_01);

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

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

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

12-
import org.elasticsearch.TransportVersion;
13-
import org.elasticsearch.TransportVersions;
1412
import org.elasticsearch.cluster.metadata.IndexMetadata;
1513
import org.elasticsearch.cluster.metadata.MappingMetadata;
1614
import org.elasticsearch.cluster.metadata.Metadata;
@@ -44,8 +42,6 @@
4442
*/
4543
public final class AnalysisStats implements ToXContentFragment, Writeable {
4644

47-
private static final TransportVersion SYNONYM_SETS_VERSION = TransportVersions.V_8_10_X;
48-
4945
private static final Set<String> SYNONYM_FILTER_TYPES = Set.of("synonym", "synonym_graph");
5046

5147
// Maps the synonyms token filter configurations to the stats keys used
@@ -289,11 +285,7 @@ public AnalysisStats(StreamInput input) throws IOException {
289285
usedBuiltInTokenizers = Collections.unmodifiableSet(new LinkedHashSet<>(input.readCollectionAsList(IndexFeatureStats::new)));
290286
usedBuiltInTokenFilters = Collections.unmodifiableSet(new LinkedHashSet<>(input.readCollectionAsList(IndexFeatureStats::new)));
291287
usedBuiltInAnalyzers = Collections.unmodifiableSet(new LinkedHashSet<>(input.readCollectionAsList(IndexFeatureStats::new)));
292-
if (input.getTransportVersion().onOrAfter(SYNONYM_SETS_VERSION)) {
293-
usedSynonyms = input.readImmutableMap(SynonymsStats::new);
294-
} else {
295-
usedSynonyms = Collections.emptyMap();
296-
}
288+
usedSynonyms = input.readImmutableMap(SynonymsStats::new);
297289
}
298290

299291
@Override
@@ -306,9 +298,7 @@ public void writeTo(StreamOutput out) throws IOException {
306298
out.writeCollection(usedBuiltInTokenizers);
307299
out.writeCollection(usedBuiltInTokenFilters);
308300
out.writeCollection(usedBuiltInAnalyzers);
309-
if (out.getTransportVersion().onOrAfter(SYNONYM_SETS_VERSION)) {
310-
out.writeMap(usedSynonyms, StreamOutput::writeWriteable);
311-
}
301+
out.writeMap(usedSynonyms, StreamOutput::writeWriteable);
312302
}
313303

314304
/**

server/src/main/java/org/elasticsearch/action/admin/indices/analyze/ReloadAnalyzersRequest.java

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

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

12-
import org.elasticsearch.TransportVersion;
13-
import org.elasticsearch.TransportVersions;
1412
import org.elasticsearch.action.support.broadcast.BroadcastRequest;
1513
import org.elasticsearch.common.io.stream.StreamInput;
1614
import org.elasticsearch.common.io.stream.StreamOutput;
@@ -26,8 +24,6 @@ public class ReloadAnalyzersRequest extends BroadcastRequest<ReloadAnalyzersRequ
2624
private final String resource;
2725
private final boolean preview;
2826

29-
private static final TransportVersion PREVIEW_OPTION_TRANSPORT_VERSION = TransportVersions.V_8_10_X;
30-
3127
/**
3228
* Constructs a request for reloading index search analyzers
3329
* @param resource changed resource to reload analyzers from, @null if not applicable
@@ -44,16 +40,14 @@ public ReloadAnalyzersRequest(String resource, boolean preview, String... indice
4440
public ReloadAnalyzersRequest(StreamInput in) throws IOException {
4541
super(in);
4642
this.resource = in.readOptionalString();
47-
this.preview = in.getTransportVersion().onOrAfter(PREVIEW_OPTION_TRANSPORT_VERSION) && in.readBoolean();
43+
this.preview = in.readBoolean();
4844
}
4945

5046
@Override
5147
public void writeTo(StreamOutput out) throws IOException {
5248
super.writeTo(out);
5349
out.writeOptionalString(resource);
54-
if (out.getTransportVersion().onOrAfter(PREVIEW_OPTION_TRANSPORT_VERSION)) {
55-
out.writeBoolean(preview);
56-
}
50+
out.writeBoolean(preview);
5751
}
5852

5953
public String resource() {

server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java

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

5151
public class CommonStats implements Writeable, ToXContentFragment {
5252

53-
private static final TransportVersion VERSION_SUPPORTING_DENSE_VECTOR_STATS = TransportVersions.V_8_10_X;
5453
private static final TransportVersion VERSION_SUPPORTING_SPARSE_VECTOR_STATS = TransportVersions.V_8_15_0;
5554

5655
@Nullable
@@ -225,9 +224,7 @@ public CommonStats(StreamInput in) throws IOException {
225224
bulk = in.readOptionalWriteable(BulkStats::new);
226225
shards = in.readOptionalWriteable(ShardCountStats::new);
227226
nodeMappings = in.readOptionalWriteable(NodeMappingStats::new);
228-
if (in.getTransportVersion().onOrAfter(VERSION_SUPPORTING_DENSE_VECTOR_STATS)) {
229-
denseVectorStats = in.readOptionalWriteable(DenseVectorStats::new);
230-
}
227+
denseVectorStats = in.readOptionalWriteable(DenseVectorStats::new);
231228
if (in.getTransportVersion().onOrAfter(VERSION_SUPPORTING_SPARSE_VECTOR_STATS)) {
232229
sparseVectorStats = in.readOptionalWriteable(SparseVectorStats::new);
233230
}
@@ -254,9 +251,7 @@ public void writeTo(StreamOutput out) throws IOException {
254251
out.writeOptionalWriteable(bulk);
255252
out.writeOptionalWriteable(shards);
256253
out.writeOptionalWriteable(nodeMappings);
257-
if (out.getTransportVersion().onOrAfter(VERSION_SUPPORTING_DENSE_VECTOR_STATS)) {
258-
out.writeOptionalWriteable(denseVectorStats);
259-
}
254+
out.writeOptionalWriteable(denseVectorStats);
260255
if (out.getTransportVersion().onOrAfter(VERSION_SUPPORTING_SPARSE_VECTOR_STATS)) {
261256
out.writeOptionalWriteable(sparseVectorStats);
262257
}

server/src/main/java/org/elasticsearch/action/downsample/DownsampleAction.java

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

11-
import org.elasticsearch.TransportVersions;
1211
import org.elasticsearch.action.ActionRequestValidationException;
1312
import org.elasticsearch.action.ActionType;
1413
import org.elasticsearch.action.IndicesRequest;
@@ -67,11 +66,7 @@ public Request(StreamInput in) throws IOException {
6766
super(in);
6867
sourceIndex = in.readString();
6968
targetIndex = in.readString();
70-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_10_X)) {
71-
waitTimeout = TimeValue.parseTimeValue(in.readString(), "timeout");
72-
} else {
73-
waitTimeout = DEFAULT_WAIT_TIMEOUT;
74-
}
69+
waitTimeout = TimeValue.parseTimeValue(in.readString(), "timeout");
7570
downsampleConfig = new DownsampleConfig(in);
7671
}
7772

@@ -95,9 +90,7 @@ public void writeTo(StreamOutput out) throws IOException {
9590
super.writeTo(out);
9691
out.writeString(sourceIndex);
9792
out.writeString(targetIndex);
98-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_10_X)) {
99-
out.writeString(waitTimeout.getStringRep());
100-
}
93+
out.writeString(waitTimeout.getStringRep());
10194
downsampleConfig.writeTo(out);
10295
}
10396

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ public class IndexRequest extends ReplicatedWriteRequest<IndexRequest> implement
7575

7676
private static final long SHALLOW_SIZE = RamUsageEstimator.shallowSizeOfInstance(IndexRequest.class);
7777

78-
private static final TransportVersion PIPELINES_HAVE_RUN_FIELD_ADDED = TransportVersions.V_8_10_X;
7978
private static final TransportVersion INDEX_REQUEST_INCLUDE_TSID = TransportVersion.fromName("index_request_include_tsid");
8079
private static final TransportVersion INDEX_SOURCE = TransportVersion.fromName("index_source");
8180
static final TransportVersion INGEST_REQUEST_DYNAMIC_TEMPLATE_PARAMS = TransportVersion.fromName(
@@ -197,10 +196,6 @@ public IndexRequest(@Nullable ShardId shardId, StreamInput in) throws IOExceptio
197196
ifPrimaryTerm = in.readVLong();
198197
requireAlias = in.readBoolean();
199198
dynamicTemplates = in.readMap(StreamInput::readString);
200-
if (in.getTransportVersion().onOrAfter(PIPELINES_HAVE_RUN_FIELD_ADDED)
201-
&& in.getTransportVersion().before(TransportVersions.V_8_13_0)) {
202-
in.readBoolean(); // obsolete, prior to tracking normalisedBytesParsed
203-
}
204199
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_12_0)) {
205200
this.listExecutedPipelines = in.readBoolean();
206201
if (listExecutedPipelines) {
@@ -791,10 +786,6 @@ private void writeBody(StreamOutput out) throws IOException {
791786
out.writeVLong(ifPrimaryTerm);
792787
out.writeBoolean(requireAlias);
793788
out.writeMap(dynamicTemplates, StreamOutput::writeString);
794-
if (out.getTransportVersion().onOrAfter(PIPELINES_HAVE_RUN_FIELD_ADDED)
795-
&& out.getTransportVersion().before(TransportVersions.V_8_13_0)) {
796-
out.writeBoolean(false); // obsolete, prior to tracking normalisedBytesParsed
797-
}
798789
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_12_0)) {
799790
out.writeBoolean(listExecutedPipelines);
800791
if (listExecutedPipelines) {

server/src/main/java/org/elasticsearch/action/search/SearchResponse.java

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -570,23 +570,17 @@ public Clusters(StreamInput in) throws IOException {
570570
this.total = in.readVInt();
571571
int successfulTemp = in.readVInt();
572572
int skippedTemp = in.readVInt();
573-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_10_X)) {
574-
List<Cluster> clusterList = in.readCollectionAsList(Cluster::new);
575-
if (clusterList.isEmpty()) {
576-
this.clusterInfo = Collections.emptyMap();
577-
this.successful = successfulTemp;
578-
this.skipped = skippedTemp;
579-
} else {
580-
Map<String, Cluster> m = ConcurrentCollections.newConcurrentMap();
581-
clusterList.forEach(c -> m.put(c.getClusterAlias(), c));
582-
this.clusterInfo = m;
583-
this.successful = getClusterStateCount(Cluster.Status.SUCCESSFUL);
584-
this.skipped = getClusterStateCount(Cluster.Status.SKIPPED);
585-
}
586-
} else {
573+
List<Cluster> clusterList = in.readCollectionAsList(Cluster::new);
574+
if (clusterList.isEmpty()) {
575+
this.clusterInfo = Collections.emptyMap();
587576
this.successful = successfulTemp;
588577
this.skipped = skippedTemp;
589-
this.clusterInfo = Collections.emptyMap();
578+
} else {
579+
Map<String, Cluster> m = ConcurrentCollections.newConcurrentMap();
580+
clusterList.forEach(c -> m.put(c.getClusterAlias(), c));
581+
this.clusterInfo = m;
582+
this.successful = getClusterStateCount(Cluster.Status.SUCCESSFUL);
583+
this.skipped = getClusterStateCount(Cluster.Status.SKIPPED);
590584
}
591585
int running = getClusterStateCount(Cluster.Status.RUNNING);
592586
int partial = getClusterStateCount(Cluster.Status.PARTIAL);
@@ -628,13 +622,11 @@ public void writeTo(StreamOutput out) throws IOException {
628622
out.writeVInt(total);
629623
out.writeVInt(successful);
630624
out.writeVInt(skipped);
631-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_10_X)) {
632-
if (clusterInfo != null) {
633-
List<Cluster> clusterList = clusterInfo.values().stream().toList();
634-
out.writeCollection(clusterList);
635-
} else {
636-
out.writeCollection(Collections.emptyList());
637-
}
625+
if (clusterInfo != null) {
626+
List<Cluster> clusterList = clusterInfo.values().stream().toList();
627+
out.writeCollection(clusterList);
628+
} else {
629+
out.writeCollection(Collections.emptyList());
638630
}
639631
}
640632

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

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
package org.elasticsearch.cluster.metadata;
1111

1212
import org.elasticsearch.TransportVersion;
13-
import org.elasticsearch.TransportVersions;
1413
import org.elasticsearch.action.admin.indices.rollover.RolloverConfiguration;
1514
import org.elasticsearch.action.downsample.DownsampleConfig;
1615
import org.elasticsearch.cluster.Diff;
@@ -53,8 +52,6 @@
5352
*/
5453
public class DataStreamLifecycle implements SimpleDiffable<DataStreamLifecycle>, ToXContentObject {
5554

56-
// Versions over the wire
57-
public static final TransportVersion ADDED_ENABLED_FLAG_VERSION = TransportVersions.V_8_10_X;
5855
public static final TransportVersion ADD_SAMPLE_METHOD_DOWNSAMPLE_DLM = TransportVersion.fromName("add_sample_method_downsample_dlm");
5956
public static final String EFFECTIVE_RETENTION_REST_API_CAPABILITY = "data_stream_lifecycle_effective_retention";
6057

@@ -344,14 +341,12 @@ public void writeTo(StreamOutput out) throws IOException {
344341
} else {
345342
writeLegacyOptionalValue(dataRetention, out, StreamOutput::writeTimeValue);
346343
}
347-
if (out.getTransportVersion().onOrAfter(ADDED_ENABLED_FLAG_VERSION)) {
348-
if (out.getTransportVersion().supports(INTRODUCE_LIFECYCLE_TEMPLATE)) {
349-
out.writeOptionalCollection(downsamplingRounds);
350-
} else {
351-
writeLegacyOptionalValue(downsamplingRounds, out, StreamOutput::writeCollection);
352-
}
353-
out.writeBoolean(enabled());
344+
if (out.getTransportVersion().supports(INTRODUCE_LIFECYCLE_TEMPLATE)) {
345+
out.writeOptionalCollection(downsamplingRounds);
346+
} else {
347+
writeLegacyOptionalValue(downsamplingRounds, out, StreamOutput::writeCollection);
354348
}
349+
out.writeBoolean(enabled());
355350
if (out.getTransportVersion().supports(INTRODUCE_FAILURES_LIFECYCLE)) {
356351
lifecycleType.writeTo(out);
357352
}
@@ -366,17 +361,12 @@ public DataStreamLifecycle(StreamInput in) throws IOException {
366361
} else {
367362
dataRetention = readLegacyOptionalValue(in, StreamInput::readTimeValue);
368363
}
369-
if (in.getTransportVersion().onOrAfter(ADDED_ENABLED_FLAG_VERSION)) {
370-
if (in.getTransportVersion().supports(INTRODUCE_LIFECYCLE_TEMPLATE)) {
371-
downsamplingRounds = in.readOptionalCollectionAsList(DownsamplingRound::read);
372-
} else {
373-
downsamplingRounds = readLegacyOptionalValue(in, is -> is.readCollectionAsList(DownsamplingRound::read));
374-
}
375-
enabled = in.readBoolean();
364+
if (in.getTransportVersion().supports(INTRODUCE_LIFECYCLE_TEMPLATE)) {
365+
downsamplingRounds = in.readOptionalCollectionAsList(DownsamplingRound::read);
376366
} else {
377-
downsamplingRounds = null;
378-
enabled = true;
367+
downsamplingRounds = readLegacyOptionalValue(in, is -> is.readCollectionAsList(DownsamplingRound::read));
379368
}
369+
enabled = in.readBoolean();
380370
lifecycleType = in.getTransportVersion().supports(INTRODUCE_FAILURES_LIFECYCLE) ? LifecycleType.read(in) : LifecycleType.DATA;
381371
downsamplingMethod = in.getTransportVersion().supports(ADD_SAMPLE_METHOD_DOWNSAMPLE_DLM)
382372
? in.readOptionalWriteable(DownsampleConfig.SamplingMethod::read)
@@ -706,14 +696,12 @@ public void writeTo(StreamOutput out) throws IOException {
706696
} else {
707697
writeLegacyValue(out, dataRetention, StreamOutput::writeTimeValue);
708698
}
709-
if (out.getTransportVersion().onOrAfter(ADDED_ENABLED_FLAG_VERSION)) {
710-
if (out.getTransportVersion().supports(INTRODUCE_LIFECYCLE_TEMPLATE)) {
711-
ResettableValue.write(out, downsamplingRounds, StreamOutput::writeCollection);
712-
} else {
713-
writeLegacyValue(out, downsamplingRounds, StreamOutput::writeCollection);
714-
}
715-
out.writeBoolean(enabled);
699+
if (out.getTransportVersion().supports(INTRODUCE_LIFECYCLE_TEMPLATE)) {
700+
ResettableValue.write(out, downsamplingRounds, StreamOutput::writeCollection);
701+
} else {
702+
writeLegacyValue(out, downsamplingRounds, StreamOutput::writeCollection);
716703
}
704+
out.writeBoolean(enabled);
717705
if (out.getTransportVersion().supports(INTRODUCE_FAILURES_LIFECYCLE)) {
718706
lifecycleType.writeTo(out);
719707
}
@@ -767,14 +755,12 @@ public static Template read(StreamInput in) throws IOException {
767755
} else {
768756
dataRetention = readLegacyValues(in, StreamInput::readTimeValue);
769757
}
770-
if (in.getTransportVersion().onOrAfter(ADDED_ENABLED_FLAG_VERSION)) {
771-
if (in.getTransportVersion().supports(INTRODUCE_LIFECYCLE_TEMPLATE)) {
772-
downsamplingRounds = ResettableValue.read(in, i -> i.readCollectionAsList(DownsamplingRound::read));
773-
} else {
774-
downsamplingRounds = readLegacyValues(in, i -> i.readCollectionAsList(DownsamplingRound::read));
775-
}
776-
enabled = in.readBoolean();
758+
if (in.getTransportVersion().supports(INTRODUCE_LIFECYCLE_TEMPLATE)) {
759+
downsamplingRounds = ResettableValue.read(in, i -> i.readCollectionAsList(DownsamplingRound::read));
760+
} else {
761+
downsamplingRounds = readLegacyValues(in, i -> i.readCollectionAsList(DownsamplingRound::read));
777762
}
763+
enabled = in.readBoolean();
778764
var lifecycleTarget = in.getTransportVersion().supports(INTRODUCE_FAILURES_LIFECYCLE)
779765
? LifecycleType.read(in)
780766
: LifecycleType.DATA;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,7 @@ public void writeTo(StreamOutput out) throws IOException {
225225
out.writeBoolean(true);
226226
out.writeMap(this.aliases, StreamOutput::writeWriteable);
227227
}
228-
if (out.getTransportVersion().onOrAfter(DataStreamLifecycle.ADDED_ENABLED_FLAG_VERSION)) {
229-
out.writeOptionalWriteable(lifecycle);
230-
}
228+
out.writeOptionalWriteable(lifecycle);
231229
ResettableValue.write(out, dataStreamOptions, (o, v) -> v.writeTo(o));
232230
}
233231

0 commit comments

Comments
 (0)