Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions server/src/main/java/org/elasticsearch/TransportVersions.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package org.elasticsearch;

import org.elasticsearch.core.Assertions;
import org.elasticsearch.core.UpdateForV9;

import java.lang.reflect.Field;
import java.util.ArrayList;
Expand Down Expand Up @@ -49,7 +48,6 @@ static TransportVersion def(int id) {
return new TransportVersion(id);
}

@UpdateForV9(owner = UpdateForV9.Owner.CORE_INFRA) // remove the transport versions with which v9 will not need to interact
public static final TransportVersion ZERO = def(0);
public static final TransportVersion V_7_0_0 = def(7_00_00_99);
public static final TransportVersion V_7_1_0 = def(7_01_00_99);
Expand Down Expand Up @@ -99,8 +97,6 @@ static TransportVersion def(int id) {
public static final TransportVersion V_8_16_1 = def(8_772_0_04);
public static final TransportVersion INITIAL_ELASTICSEARCH_8_16_5 = def(8_772_0_05);
public static final TransportVersion INITIAL_ELASTICSEARCH_8_16_6 = def(8_772_0_06);
public static final TransportVersion REMOVE_MIN_COMPATIBLE_SHARD_NODE = def(8_773_0_00);
public static final TransportVersion REVERT_REMOVE_MIN_COMPATIBLE_SHARD_NODE = def(8_774_0_00);
public static final TransportVersion V_8_17_0 = def(8_797_0_02);
public static final TransportVersion INITIAL_ELASTICSEARCH_8_17_3 = def(8_797_0_03);
public static final TransportVersion INITIAL_ELASTICSEARCH_8_17_4 = def(8_797_0_04);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
import org.elasticsearch.common.metrics.CounterMetric;
import org.elasticsearch.core.Strings;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.core.UpdateForV9;
import org.elasticsearch.logging.LogManager;
import org.elasticsearch.logging.Logger;
import org.elasticsearch.threadpool.ThreadPool;

import java.io.EOFException;
import java.io.IOException;
import java.util.Objects;
import java.util.Set;
Expand Down Expand Up @@ -357,28 +355,18 @@ static final class HandshakeRequest extends TransportRequest {
this.releaseVersion = Objects.requireNonNull(releaseVersion);
}

@UpdateForV9(owner = UpdateForV9.Owner.CORE_INFRA) // remainingMessage == null is invalid in v9
HandshakeRequest(StreamInput streamInput) throws IOException {
super(streamInput);
BytesReference remainingMessage;
try {
remainingMessage = streamInput.readSlicedBytesReference();
} catch (EOFException e) {
remainingMessage = null;
}
if (remainingMessage == null) {
transportVersion = null;
releaseVersion = null;
} else {
try (StreamInput messageStreamInput = remainingMessage.streamInput()) {
this.transportVersion = TransportVersion.readVersion(messageStreamInput);
if (streamInput.getTransportVersion().onOrAfter(V9_HANDSHAKE_VERSION)) {
this.releaseVersion = messageStreamInput.readString();
} else {
this.releaseVersion = this.transportVersion.toReleaseVersion();
}

try (StreamInput messageStreamInput = streamInput.readSlicedBytesReference().streamInput()) {
this.transportVersion = TransportVersion.readVersion(messageStreamInput);
if (streamInput.getTransportVersion().onOrAfter(V9_HANDSHAKE_VERSION)) {
this.releaseVersion = messageStreamInput.readString();
} else {
this.releaseVersion = this.transportVersion.toReleaseVersion();
}
}

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.elasticsearch.core.IOUtils;
import org.elasticsearch.core.PathUtils;
import org.elasticsearch.core.SuppressForbidden;
import org.elasticsearch.core.UpdateForV9;
import org.elasticsearch.gateway.MetadataStateFormat;
import org.elasticsearch.gateway.PersistedClusterStateService;
import org.elasticsearch.index.Index;
Expand Down Expand Up @@ -539,8 +538,6 @@ public void testBlocksDowngradeToVersionWithMultipleNodesInDataPath() throws IOE
}
}

@UpdateForV9(owner = UpdateForV9.Owner.CORE_INFRA)
@AwaitsFix(bugUrl = "test won't work until we remove and bump minimum index versions")
public void testIndexCompatibilityChecks() throws IOException {
final Settings settings = buildEnvSettings(Settings.EMPTY);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.apache.logging.log4j.Level;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.PlainActionFuture;
import org.elasticsearch.cluster.node.DiscoveryNode;
Expand All @@ -35,7 +34,6 @@
import org.elasticsearch.core.Streams;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.core.Tuple;
import org.elasticsearch.core.UpdateForV9;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.MockLog;
import org.elasticsearch.test.TransportVersionUtils;
Expand Down Expand Up @@ -141,8 +139,7 @@ public void testSendRequest() throws IOException {
TransportVersion version = isHandshake
? randomFrom(TransportHandshaker.ALLOWED_HANDSHAKE_VERSIONS)
: TransportVersionUtils.randomCompatibleVersion(random());
@UpdateForV9(owner = UpdateForV9.Owner.CORE_INFRA) // drop the version.onOrAfter() in v9
boolean compress = version.onOrAfter(TransportVersions.MINIMUM_COMPATIBLE) && randomBoolean();
boolean compress = randomBoolean();
String value = "message";
threadContext.putHeader("header", "header_value");
TestRequest request = new TestRequest(value);
Expand Down Expand Up @@ -215,8 +212,7 @@ public void testSendResponse() throws IOException {
TransportVersion version = isHandshake
? randomFrom(TransportHandshaker.ALLOWED_HANDSHAKE_VERSIONS)
: TransportVersionUtils.randomCompatibleVersion(random());
@UpdateForV9(owner = UpdateForV9.Owner.CORE_INFRA) // drop the version.onOrAfter() in v9
boolean compress = version.onOrAfter(TransportVersions.MINIMUM_COMPATIBLE) && randomBoolean();
boolean compress = randomBoolean();

String value = "message";
threadContext.putHeader("header", "header_value");
Expand Down