Skip to content

Commit 57f99ad

Browse files
thecoopjfreden
authored andcommitted
Remove 7.17 transport versions (elastic#124196)
1 parent 148dbcc commit 57f99ad

File tree

13 files changed

+36
-65
lines changed

13 files changed

+36
-65
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ static TransportVersion def(int id) {
6060
public static final TransportVersion V_7_8_1 = def(7_08_01_99);
6161
public static final TransportVersion V_7_9_0 = def(7_09_00_99);
6262
public static final TransportVersion V_7_10_0 = def(7_10_00_99);
63-
public static final TransportVersion V_7_17_0 = def(7_17_00_99);
64-
public static final TransportVersion V_7_17_1 = def(7_17_01_99);
65-
public static final TransportVersion V_7_17_8 = def(7_17_08_99);
6663
public static final TransportVersion V_8_0_0 = def(8_00_00_99);
6764
public static final TransportVersion V_8_1_0 = def(8_01_00_99);
6865
public static final TransportVersion V_8_2_0 = def(8_02_00_99);

server/src/main/java/org/elasticsearch/indices/store/TransportNodesListShardStoreMetadata.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,6 @@ public void writeTo(StreamOutput out) throws IOException {
221221
if (out.getTransportVersion().before(TransportVersions.V_8_2_0)) {
222222
// no compatible version cares about the shard ID, we can just make one up
223223
FAKE_SHARD_ID.writeTo(out);
224-
225-
// NB only checked this for versions back to 7.17.0, we are assuming that we don't use this with earlier versions:
226-
assert out.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0) : out.getTransportVersion();
227224
}
228225
metadataSnapshot.writeTo(out);
229226
out.writeCollection(peerRecoveryRetentionLeases);

server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalBinaryRange.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,9 @@ private static String generateKey(BytesRef from, BytesRef to, DocValueFormat for
5858
}
5959

6060
private static Bucket createFromStream(StreamInput in, DocValueFormat format) throws IOException {
61-
// NOTE: the key is required in version == 8.0.0 and version <= 7.17.0,
61+
// NOTE: the key is required in version == 8.0.0,
6262
// while it is optional for all subsequent versions.
63-
String key = in.getTransportVersion().equals(TransportVersions.V_8_0_0) ? in.readString()
64-
: in.getTransportVersion().onOrAfter(TransportVersions.V_7_17_1) ? in.readOptionalString()
65-
: in.readString();
63+
String key = in.getTransportVersion().equals(TransportVersions.V_8_0_0) ? in.readString() : in.readOptionalString();
6664
BytesRef from = in.readOptional(StreamInput::readBytesRef);
6765
BytesRef to = in.readOptional(StreamInput::readBytesRef);
6866
long docCount = in.readLong();
@@ -75,10 +73,8 @@ private static Bucket createFromStream(StreamInput in, DocValueFormat format) th
7573
public void writeTo(StreamOutput out) throws IOException {
7674
if (out.getTransportVersion().equals(TransportVersions.V_8_0_0)) {
7775
out.writeString(key == null ? generateKey(from, to, format) : key);
78-
} else if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_17_1)) {
79-
out.writeOptionalString(key);
8076
} else {
81-
out.writeString(key == null ? generateKey(from, to, format) : key);
77+
out.writeOptionalString(key);
8278
}
8379
out.writeOptional(StreamOutput::writeBytesRef, from);
8480
out.writeOptional(StreamOutput::writeBytesRef, to);

server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -138,23 +138,17 @@ private static String generateKey(double from, double to, DocValueFormat format)
138138

139139
@Override
140140
public void writeTo(StreamOutput out) throws IOException {
141-
// NOTE: the key is required in version == 8.0.0 and version <= 7.17.0,
141+
// NOTE: the key is required in version == 8.0.0,
142142
// while it is optional for all subsequent versions.
143143
if (out.getTransportVersion().equals(TransportVersions.V_8_0_0)) {
144144
out.writeString(key == null ? generateKey(from, to, format) : key);
145-
} else if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_17_1)) {
146-
out.writeOptionalString(key);
147145
} else {
148-
out.writeString(key == null ? generateKey(from, to, format) : key);
146+
out.writeOptionalString(key);
149147
}
150148
out.writeDouble(from);
151-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0)) {
152-
out.writeOptionalDouble(from);
153-
}
149+
out.writeOptionalDouble(from);
154150
out.writeDouble(to);
155-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0)) {
156-
out.writeOptionalDouble(to);
157-
}
151+
out.writeOptionalDouble(to);
158152
out.writeVLong(docCount);
159153
aggregations.writeTo(out);
160154
}
@@ -236,28 +230,22 @@ public InternalRange(StreamInput in) throws IOException {
236230
int size = in.readVInt();
237231
List<B> ranges = new ArrayList<>(size);
238232
for (int i = 0; i < size; i++) {
239-
// NOTE: the key is required in version == 8.0.0 and version <= 7.17.0,
233+
// NOTE: the key is required in version == 8.0.0,
240234
// while it is optional for all subsequent versions.
241-
final String key = in.getTransportVersion().equals(TransportVersions.V_8_0_0) ? in.readString()
242-
: in.getTransportVersion().onOrAfter(TransportVersions.V_7_17_1) ? in.readOptionalString()
243-
: in.readString();
235+
final String key = in.getTransportVersion().equals(TransportVersions.V_8_0_0) ? in.readString() : in.readOptionalString();
244236
double from = in.readDouble();
245-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0)) {
246-
final Double originalFrom = in.readOptionalDouble();
247-
if (originalFrom != null) {
248-
from = originalFrom;
249-
} else {
250-
from = Double.NEGATIVE_INFINITY;
251-
}
237+
final Double originalFrom = in.readOptionalDouble();
238+
if (originalFrom != null) {
239+
from = originalFrom;
240+
} else {
241+
from = Double.NEGATIVE_INFINITY;
252242
}
253243
double to = in.readDouble();
254-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0)) {
255-
final Double originalTo = in.readOptionalDouble();
256-
if (originalTo != null) {
257-
to = originalTo;
258-
} else {
259-
to = Double.POSITIVE_INFINITY;
260-
}
244+
final Double originalTo = in.readOptionalDouble();
245+
if (originalTo != null) {
246+
to = originalTo;
247+
} else {
248+
to = Double.POSITIVE_INFINITY;
261249
}
262250
long docCount = in.readVLong();
263251
InternalAggregations aggregations = InternalAggregations.readFrom(in);

server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregator.java

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

1111
import org.apache.lucene.search.ScoreMode;
1212
import org.apache.lucene.search.ScorerSupplier;
13-
import org.elasticsearch.TransportVersions;
1413
import org.elasticsearch.common.io.stream.StreamInput;
1514
import org.elasticsearch.common.io.stream.StreamOutput;
1615
import org.elasticsearch.common.io.stream.Writeable;
@@ -176,8 +175,8 @@ public Range(StreamInput in) throws IOException {
176175
toAsStr = in.readOptionalString();
177176
from = in.readDouble();
178177
to = in.readDouble();
179-
originalFrom = in.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0) ? in.readOptionalDouble() : Double.valueOf(from);
180-
originalTo = in.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0) ? in.readOptionalDouble() : Double.valueOf(to);
178+
originalFrom = in.readOptionalDouble();
179+
originalTo = in.readOptionalDouble();
181180
}
182181

183182
@Override
@@ -187,10 +186,8 @@ public void writeTo(StreamOutput out) throws IOException {
187186
out.writeOptionalString(toAsStr);
188187
out.writeDouble(from);
189188
out.writeDouble(to);
190-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0)) {
191-
out.writeOptionalDouble(originalFrom);
192-
out.writeOptionalDouble(originalTo);
193-
}
189+
out.writeOptionalDouble(originalFrom);
190+
out.writeOptionalDouble(originalTo);
194191
}
195192

196193
public double getFrom() {

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformTaskParams.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public String getWriteableName() {
9393

9494
@Override
9595
public TransportVersion getMinimalSupportedVersion() {
96-
return TransportVersions.V_7_17_0;
96+
return TransportVersions.ZERO;
9797
}
9898

9999
@Override

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponseTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void testSerializationWithRemoteIndicesThrowsOnUnsupportedVersions() thro
9292
);
9393
final TransportVersion version = TransportVersionUtils.randomVersionBetween(
9494
random(),
95-
TransportVersions.V_7_17_0,
95+
TransportVersions.V_8_0_0,
9696
versionBeforeAdvancedRemoteClusterSecurity
9797
);
9898
out.setTransportVersion(version);

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationSerializationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public void testWriteToWithCrossClusterAccessThrowsOnUnsupportedVersion() throws
8989
final BytesStreamOutput out = new BytesStreamOutput();
9090
final TransportVersion version = TransportVersionUtils.randomVersionBetween(
9191
random(),
92-
TransportVersions.V_7_17_0,
92+
TransportVersions.V_8_0_0,
9393
TransportVersionUtils.getPreviousVersion(RemoteClusterPortSettings.TRANSPORT_VERSION_ADVANCED_REMOTE_CLUSTER_SECURITY)
9494
);
9595
out.setTransportVersion(version);

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ public void testMaybeRewriteForOlderVersionWithCrossClusterAccessThrowsOnUnsuppo
853853
);
854854
final TransportVersion version = TransportVersionUtils.randomVersionBetween(
855855
random(),
856-
TransportVersions.V_7_17_0, // the minimum compatible version of 8.x
856+
TransportVersions.V_8_0_0,
857857
versionBeforeCrossClusterAccessRealm
858858
);
859859

@@ -958,7 +958,7 @@ public void testCopyWithFilteredMetadataFields() {
958958
public void testMaybeRewriteForOlderVersionErasesDomainForVersionsBeforeDomains() {
959959
final TransportVersion olderVersion = TransportVersionUtils.randomVersionBetween(
960960
random(),
961-
TransportVersions.V_7_17_0,
961+
TransportVersions.V_8_0_0,
962962
TransportVersionUtils.getPreviousVersion(Authentication.VERSION_REALM_DOMAINS)
963963
);
964964
final Authentication authentication = AuthenticationTestHelper.builder()

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptorTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ public void testSerializationWithRemoteIndicesWithElderVersion() throws IOExcept
651651
final TransportVersion versionBeforeRemoteIndices = TransportVersionUtils.getPreviousVersion(TransportVersions.V_8_8_0);
652652
final TransportVersion version = TransportVersionUtils.randomVersionBetween(
653653
random(),
654-
TransportVersions.V_7_17_0,
654+
TransportVersions.V_8_0_0,
655655
versionBeforeRemoteIndices
656656
);
657657
final BytesStreamOutput output = new BytesStreamOutput();
@@ -702,7 +702,7 @@ public void testSerializationWithRemoteClusterWithElderVersion() throws IOExcept
702702
final TransportVersion versionBeforeRemoteCluster = TransportVersionUtils.getPreviousVersion(ROLE_REMOTE_CLUSTER_PRIVS);
703703
final TransportVersion version = TransportVersionUtils.randomVersionBetween(
704704
random(),
705-
TransportVersions.V_7_17_0,
705+
TransportVersions.V_8_0_0,
706706
versionBeforeRemoteCluster
707707
);
708708
final BytesStreamOutput output = new BytesStreamOutput();
@@ -753,7 +753,7 @@ public void testSerializationWithWorkflowsRestrictionAndUnsupportedVersions() th
753753
final TransportVersion versionBeforeWorkflowsRestriction = TransportVersionUtils.getPreviousVersion(WORKFLOWS_RESTRICTION_VERSION);
754754
final TransportVersion version = TransportVersionUtils.randomVersionBetween(
755755
random(),
756-
TransportVersions.V_7_17_0,
756+
TransportVersions.V_8_0_0,
757757
versionBeforeWorkflowsRestriction
758758
);
759759
final BytesStreamOutput output = new BytesStreamOutput();
@@ -848,7 +848,7 @@ public void testSerializationWithDescriptionAndUnsupportedVersions() throws IOEx
848848
final TransportVersion versionBeforeRoleDescription = TransportVersionUtils.getPreviousVersion(SECURITY_ROLE_DESCRIPTION);
849849
final TransportVersion version = TransportVersionUtils.randomVersionBetween(
850850
random(),
851-
TransportVersions.V_7_17_0,
851+
TransportVersions.V_8_0_0,
852852
versionBeforeRoleDescription
853853
);
854854
final BytesStreamOutput output = new BytesStreamOutput();

0 commit comments

Comments
 (0)