Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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 @@ -143,7 +143,6 @@ static TransportVersion def(int id) {
public static final TransportVersion TIMEOUT_GET_PARAM_FOR_RESOLVE_CLUSTER = def(8_838_0_00);
public static final TransportVersion INFERENCE_REQUEST_ADAPTIVE_RATE_LIMITING = def(8_839_0_00);
public static final TransportVersion ML_INFERENCE_IBM_WATSONX_RERANK_ADDED = def(8_840_0_00);
public static final TransportVersion REMOVE_ALL_APPLICABLE_SELECTOR_BACKPORT_8_18 = def(8_840_0_01);
public static final TransportVersion V_8_18_0 = def(8_840_0_02);
public static final TransportVersion INITIAL_ELASTICSEARCH_8_18_1 = def(8_840_0_03);
public static final TransportVersion INITIAL_ELASTICSEARCH_8_18_2 = def(8_840_0_04);
Expand All @@ -152,7 +151,6 @@ static TransportVersion def(int id) {
public static final TransportVersion INITIAL_ELASTICSEARCH_8_18_6 = def(8_840_0_08);
public static final TransportVersion INITIAL_ELASTICSEARCH_8_19 = def(8_841_0_00);
public static final TransportVersion COHERE_BIT_EMBEDDING_TYPE_SUPPORT_ADDED_BACKPORT_8_X = def(8_841_0_01);
public static final TransportVersion REMOVE_ALL_APPLICABLE_SELECTOR_BACKPORT_8_19 = def(8_841_0_02);
public static final TransportVersion ESQL_RETRY_ON_SHARD_LEVEL_FAILURE_BACKPORT_8_19 = def(8_841_0_03);
public static final TransportVersion ESQL_SUPPORT_PARTIAL_RESULTS_BACKPORT_8_19 = def(8_841_0_04);
public static final TransportVersion VOYAGE_AI_INTEGRATION_ADDED_BACKPORT_8_X = def(8_841_0_05);
Expand Down Expand Up @@ -216,7 +214,6 @@ static TransportVersion def(int id) {
public static final TransportVersion INITIAL_ELASTICSEARCH_8_19_1 = def(8_841_0_65);
public static final TransportVersion INITIAL_ELASTICSEARCH_8_19_2 = def(8_841_0_66);
public static final TransportVersion INITIAL_ELASTICSEARCH_8_19_3 = def(8_841_0_67);
public static final TransportVersion V_9_0_0 = def(9_000_0_09);
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_1 = def(9_000_0_10);
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_2 = def(9_000_0_11);
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_3 = def(9_000_0_12);
Expand All @@ -230,7 +227,6 @@ static TransportVersion def(int id) {
public static final TransportVersion ESQL_RETRY_ON_SHARD_LEVEL_FAILURE = def(9_006_0_00);
public static final TransportVersion ESQL_PROFILE_ASYNC_NANOS = def(9_007_00_0);
public static final TransportVersion ESQL_LOOKUP_JOIN_SOURCE_TEXT = def(9_008_0_00);
public static final TransportVersion REMOVE_ALL_APPLICABLE_SELECTOR = def(9_009_0_00);
public static final TransportVersion SLM_UNHEALTHY_IF_NO_SNAPSHOT_WITHIN = def(9_010_0_00);
public static final TransportVersion ESQL_SUPPORT_PARTIAL_RESULTS = def(9_011_0_00);
public static final TransportVersion REMOVE_REPOSITORY_CONFLICT_MESSAGE = def(9_012_0_00);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

package org.elasticsearch.action.admin.cluster.snapshots.get;

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.common.Strings;
Expand All @@ -31,6 +32,8 @@
*/
public class GetSnapshotsResponse extends ActionResponse implements ChunkedToXContentObject {

private static final TransportVersion V_9_0_0 = TransportVersion.fromName("v_9_0_0");

private final List<SnapshotInfo> snapshots;

@Nullable
Expand All @@ -50,7 +53,7 @@ public GetSnapshotsResponse(List<SnapshotInfo> snapshots, @Nullable String next,
public GetSnapshotsResponse(StreamInput in) throws IOException {
this.snapshots = in.readCollectionAsImmutableList(SnapshotInfo::readFrom);
if (in.getTransportVersion().before(TransportVersions.REMOVE_SNAPSHOT_FAILURES)
&& in.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0) == false) {
&& in.getTransportVersion().isPatchFrom(V_9_0_0) == false) {
// Deprecated `failures` field
in.readMap(StreamInput::readException);
}
Expand Down Expand Up @@ -85,7 +88,7 @@ public int remaining() {
public void writeTo(StreamOutput out) throws IOException {
out.writeCollection(snapshots);
if (out.getTransportVersion().before(TransportVersions.REMOVE_SNAPSHOT_FAILURES)
&& out.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0) == false) {
&& out.getTransportVersion().isPatchFrom(V_9_0_0) == false) {
// Deprecated `failures` field
out.writeMap(Map.of(), StreamOutput::writeException);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

package org.elasticsearch.action.admin.cluster.storedscripts;

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.master.AcknowledgedRequest;
Expand All @@ -32,6 +33,8 @@

public class PutStoredScriptRequest extends AcknowledgedRequest<PutStoredScriptRequest> implements ToXContentFragment {

private static final TransportVersion V_9_0_0 = TransportVersion.fromName("v_9_0_0");

@Nullable
private final String id;

Expand All @@ -45,7 +48,7 @@ public class PutStoredScriptRequest extends AcknowledgedRequest<PutStoredScriptR
public PutStoredScriptRequest(StreamInput in) throws IOException {
super(in);
id = in.readOptionalString();
if (in.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0)
if (in.getTransportVersion().isPatchFrom(V_9_0_0)
|| in.getTransportVersion().onOrAfter(TransportVersions.STORED_SCRIPT_CONTENT_LENGTH)) {
contentLength = in.readVInt();
} else {
Expand Down Expand Up @@ -106,7 +109,7 @@ public StoredScriptSource source() {
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeOptionalString(id);
if (out.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0)
if (out.getTransportVersion().isPatchFrom(V_9_0_0)
|| out.getTransportVersion().onOrAfter(TransportVersions.STORED_SCRIPT_CONTENT_LENGTH)) {
out.writeVInt(contentLength);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

package org.elasticsearch.action.search;

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionRequestValidationException;
Expand Down Expand Up @@ -55,6 +56,8 @@
*/
public class SearchRequest extends LegacyActionRequest implements IndicesRequest.Replaceable, Rewriteable<SearchRequest> {

private static final TransportVersion V_9_0_0 = TransportVersion.fromName("v_9_0_0");

public static final ToXContent.Params FORMAT_PARAMS = new ToXContent.MapParams(Collections.singletonMap("pretty", "false"));

public static final int DEFAULT_PRE_FILTER_SHARD_SIZE = 128;
Expand Down Expand Up @@ -254,7 +257,7 @@ public SearchRequest(StreamInput in) throws IOException {
finalReduce = true;
}
ccsMinimizeRoundtrips = in.readBoolean();
if ((in.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0) == false
if ((in.getTransportVersion().isPatchFrom(V_9_0_0) == false
&& in.getTransportVersion().before(TransportVersions.RE_REMOVE_MIN_COMPATIBLE_SHARD_NODE)) && in.readBoolean()) {
Version.readVersion(in); // and drop on the floor
}
Expand Down Expand Up @@ -299,7 +302,7 @@ public void writeTo(StreamOutput out, boolean skipIndices) throws IOException {
out.writeBoolean(finalReduce);
}
out.writeBoolean(ccsMinimizeRoundtrips);
if ((out.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0) == false
if ((out.getTransportVersion().isPatchFrom(V_9_0_0) == false
&& out.getTransportVersion().before(TransportVersions.RE_REMOVE_MIN_COMPATIBLE_SHARD_NODE))) {
out.writeBoolean(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

package org.elasticsearch.action.support;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
Expand Down Expand Up @@ -46,6 +46,9 @@ public byte getId() {
return id;
}

private static final TransportVersion REMOVE_ALL_APPLICABLE_SELECTOR = TransportVersion.fromName("remove_all_applicable_selector");
private static final TransportVersion V_9_0_0 = TransportVersion.fromName("v_9_0_0");

private static final Map<String, IndexComponentSelector> KEY_REGISTRY;
private static final Map<Byte, IndexComponentSelector> ID_REGISTRY;

Expand Down Expand Up @@ -92,10 +95,7 @@ public static IndexComponentSelector getByKeyOrThrow(@Nullable String key) {

public static IndexComponentSelector read(StreamInput in) throws IOException {
byte id = in.readByte();
if (in.getTransportVersion().onOrAfter(TransportVersions.REMOVE_ALL_APPLICABLE_SELECTOR)
|| in.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0)
|| in.getTransportVersion().isPatchFrom(TransportVersions.REMOVE_ALL_APPLICABLE_SELECTOR_BACKPORT_8_18)
|| in.getTransportVersion().isPatchFrom(TransportVersions.REMOVE_ALL_APPLICABLE_SELECTOR_BACKPORT_8_19)) {
if (in.getTransportVersion().supports(REMOVE_ALL_APPLICABLE_SELECTOR) || in.getTransportVersion().isPatchFrom(V_9_0_0)) {
return getById(id);
} else {
// Legacy value ::*, converted to ::data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
public final class DesiredNode implements Writeable, ToXContentObject, Comparable<DesiredNode> {

public static final TransportVersion RANGE_FLOAT_PROCESSORS_SUPPORT_TRANSPORT_VERSION = TransportVersions.V_8_3_0;
private static final TransportVersion V_9_0_0 = TransportVersion.fromName("v_9_0_0");

private static final ParseField SETTINGS_FIELD = new ParseField("settings");
private static final ParseField PROCESSORS_FIELD = new ParseField("processors");
Expand Down Expand Up @@ -162,7 +163,7 @@ public static DesiredNode readFrom(StreamInput in) throws IOException {
final var memory = ByteSizeValue.readFrom(in);
final var storage = ByteSizeValue.readFrom(in);
if (in.getTransportVersion().before(TransportVersions.REMOVE_DESIRED_NODE_VERSION)
&& in.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0) == false) {
&& in.getTransportVersion().isPatchFrom(V_9_0_0) == false) {
in.readOptionalString();
}
return new DesiredNode(settings, processors, processorsRange, memory, storage);
Expand All @@ -182,7 +183,7 @@ public void writeTo(StreamOutput out) throws IOException {
memory.writeTo(out);
storage.writeTo(out);
if (out.getTransportVersion().before(TransportVersions.REMOVE_DESIRED_NODE_VERSION)
&& out.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0) == false) {
&& out.getTransportVersion().isPatchFrom(V_9_0_0) == false) {
out.writeOptionalString(null);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import static org.elasticsearch.TransportVersions.BYTE_SIZE_VALUE_ALWAYS_USES_BYTES;
import static org.elasticsearch.TransportVersions.BYTE_SIZE_VALUE_ALWAYS_USES_BYTES_1;
import static org.elasticsearch.TransportVersions.REVERT_BYTE_SIZE_VALUE_ALWAYS_USES_BYTES_1;
import static org.elasticsearch.TransportVersions.V_9_0_0;
import static org.elasticsearch.common.unit.ByteSizeUnit.BYTES;
import static org.elasticsearch.common.unit.ByteSizeUnit.GB;
import static org.elasticsearch.common.unit.ByteSizeUnit.KB;
Expand All @@ -47,6 +46,8 @@ static class DeprecationLoggerHolder {
static DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(ByteSizeValue.class);
}

private static final TransportVersion V_9_0_0 = TransportVersion.fromName("v_9_0_0");

public static final ByteSizeValue ZERO = new ByteSizeValue(0, BYTES);
public static final ByteSizeValue ONE = new ByteSizeValue(1, BYTES);
public static final ByteSizeValue MINUS_ONE = new ByteSizeValue(-1, BYTES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

package org.elasticsearch.transport;

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.common.collect.Iterators;
import org.elasticsearch.common.io.stream.StreamInput;
Expand All @@ -29,6 +30,8 @@

public class TransportStats implements Writeable, ChunkedToXContent {

private static final TransportVersion V_9_0_0 = TransportVersion.fromName("v_9_0_0");

private final long serverOpen;
private final long totalOutboundConnections;
private final long rxCount;
Expand Down Expand Up @@ -70,7 +73,7 @@ public TransportStats(StreamInput in) throws IOException {
txCount = in.readVLong();
txSize = in.readVLong();
if (in.getTransportVersion().before(TransportVersions.TRANSPORT_STATS_HANDLING_TIME_REQUIRED)
&& in.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0) == false) {
&& in.getTransportVersion().isPatchFrom(V_9_0_0) == false) {
in.readBoolean();
}
inboundHandlingTimeBucketFrequencies = new long[HandlingTimeTracker.BUCKET_COUNT];
Expand Down Expand Up @@ -100,7 +103,7 @@ public void writeTo(StreamOutput out) throws IOException {
assert inboundHandlingTimeBucketFrequencies.length == HandlingTimeTracker.BUCKET_COUNT;
assert outboundHandlingTimeBucketFrequencies.length == HandlingTimeTracker.BUCKET_COUNT;
if (out.getTransportVersion().before(TransportVersions.TRANSPORT_STATS_HANDLING_TIME_REQUIRED)
&& out.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0) == false) {
&& out.getTransportVersion().isPatchFrom(V_9_0_0) == false) {
out.writeBoolean(true);
}
for (long handlingTimeBucketFrequency : inboundHandlingTimeBucketFrequencies) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9009000,8841002,8840001
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9000009
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.io.stream.Writeable.Reader;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
Expand Down Expand Up @@ -538,7 +537,7 @@ public void testBWCTransportFormat() throws IOException {
}

public void testTransportRoundTripsWithTwoDigitFractions() throws IOException {
for (var tv : List.of(TransportVersion.current(), BYTE_SIZE_VALUE_ALWAYS_USES_BYTES, TransportVersions.V_9_0_0)) {
for (var tv : List.of(TransportVersion.current(), BYTE_SIZE_VALUE_ALWAYS_USES_BYTES, TransportVersion.fromName("v_9_0_0"))) {
for (var desiredUnit : ByteSizeUnit.values()) {
if (desiredUnit == ByteSizeUnit.BYTES) {
// Can't have a fraction of a byte!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package org.elasticsearch.xpack.core.ilm.action;

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest;
Expand All @@ -21,6 +22,9 @@
import java.util.Objects;

public class RetryActionRequest extends AcknowledgedRequest<RetryActionRequest> implements IndicesRequest.Replaceable {

private static final TransportVersion V_9_0_0 = TransportVersion.fromName("v_9_0_0");

private String[] indices;
private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpen();
private boolean requireError = true;
Expand All @@ -35,7 +39,7 @@ public RetryActionRequest(StreamInput in) throws IOException {
this.indices = in.readStringArray();
this.indicesOptions = IndicesOptions.readIndicesOptions(in);
if (in.getTransportVersion().onOrAfter(TransportVersions.RETRY_ILM_ASYNC_ACTION_REQUIRE_ERROR)
|| in.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0)
|| in.getTransportVersion().isPatchFrom(V_9_0_0)
|| in.getTransportVersion().isPatchFrom(TransportVersions.RETRY_ILM_ASYNC_ACTION_REQUIRE_ERROR_8_19)
|| in.getTransportVersion().isPatchFrom(TransportVersions.V_8_18_0)) {
this.requireError = in.readBoolean();
Expand Down Expand Up @@ -82,7 +86,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeStringArray(indices);
indicesOptions.writeIndicesOptions(out);
if (out.getTransportVersion().onOrAfter(TransportVersions.RETRY_ILM_ASYNC_ACTION_REQUIRE_ERROR)
|| out.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0)
|| out.getTransportVersion().isPatchFrom(V_9_0_0)
|| out.getTransportVersion().isPatchFrom(TransportVersions.RETRY_ILM_ASYNC_ACTION_REQUIRE_ERROR_8_19)
|| out.getTransportVersion().isPatchFrom(TransportVersions.V_8_18_0)) {
out.writeBoolean(requireError);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package org.elasticsearch.compute.operator;

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.collect.Iterators;
Expand Down Expand Up @@ -49,10 +50,12 @@ public record DriverProfile(
DriverSleeps sleeps
) implements Writeable, ChunkedToXContentObject {

private static final TransportVersion V_9_0_0 = TransportVersion.fromName("v_9_0_0");

public static DriverProfile readFrom(StreamInput in) throws IOException {
return new DriverProfile(
in.getTransportVersion().onOrAfter(TransportVersions.ESQL_DRIVER_TASK_DESCRIPTION)
|| in.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0)
|| in.getTransportVersion().isPatchFrom(V_9_0_0)
|| in.getTransportVersion().isPatchFrom(TransportVersions.ESQL_DRIVER_TASK_DESCRIPTION_8_19) ? in.readString() : "",
in.getTransportVersion().onOrAfter(TransportVersions.ESQL_DRIVER_NODE_DESCRIPTION) ? in.readString() : "",
in.getTransportVersion().onOrAfter(TransportVersions.ESQL_DRIVER_NODE_DESCRIPTION) ? in.readString() : "",
Expand All @@ -69,7 +72,7 @@ public static DriverProfile readFrom(StreamInput in) throws IOException {
@Override
public void writeTo(StreamOutput out) throws IOException {
if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_DRIVER_TASK_DESCRIPTION)
|| out.getTransportVersion().isPatchFrom(TransportVersions.V_9_0_0)
|| out.getTransportVersion().isPatchFrom(V_9_0_0)
|| out.getTransportVersion().isPatchFrom(TransportVersions.ESQL_DRIVER_TASK_DESCRIPTION_8_19)) {
out.writeString(description);
}
Expand Down
Loading