Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,8 @@ private enum ElasticsearchExceptionHandle {
183,
TransportVersions.V_8_16_0
),
REMOTE_EXCEPTION(RemoteException.class, RemoteException::new, 184, TransportVersions.REMOTE_EXCEPTION_8_19);
// requires from id since remote_exception is a dead transport version on main
REMOTE_EXCEPTION(RemoteException.class, RemoteException::new, 184, TransportVersion.fromId(8841016));

final Class<? extends ElasticsearchException> exceptionClass;
final CheckedFunction<StreamInput, ? extends ElasticsearchException, IOException> constructor;
Expand Down
33 changes: 0 additions & 33 deletions server/src/main/java/org/elasticsearch/TransportVersions.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,39 +178,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 RETRY_ILM_ASYNC_ACTION_REQUIRE_ERROR_8_18 = def(8_840_0_02);
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);
public static final TransportVersion JINA_AI_EMBEDDING_TYPE_SUPPORT_ADDED_BACKPORT_8_19 = def(8_841_0_06);
public static final TransportVersion RETRY_ILM_ASYNC_ACTION_REQUIRE_ERROR_8_19 = def(8_841_0_07);
public static final TransportVersion INFERENCE_CONTEXT_8_X = def(8_841_0_08);
public static final TransportVersion ML_INFERENCE_DEEPSEEK_8_19 = def(8_841_0_09);
public static final TransportVersion ESQL_SERIALIZE_BLOCK_TYPE_CODE = def(8_841_0_10);
public static final TransportVersion ESQL_FAILURE_FROM_REMOTE = def(8_841_0_11);
public static final TransportVersion ESQL_AGGREGATE_METRIC_DOUBLE_LITERAL = def(8_841_0_12);
public static final TransportVersion INFERENCE_MODEL_REGISTRY_METADATA_8_19 = def(8_841_0_13);
public static final TransportVersion INTRODUCE_LIFECYCLE_TEMPLATE_8_19 = def(8_841_0_14);
public static final TransportVersion RERANK_COMMON_OPTIONS_ADDED_8_19 = def(8_841_0_15);
public static final TransportVersion REMOTE_EXCEPTION_8_19 = def(8_841_0_16);
public static final TransportVersion AMAZON_BEDROCK_TASK_SETTINGS_8_19 = def(8_841_0_17);
public static final TransportVersion SEMANTIC_TEXT_CHUNKING_CONFIG_8_19 = def(8_841_0_18);
public static final TransportVersion BATCHED_QUERY_PHASE_VERSION_BACKPORT_8_X = def(8_841_0_19);
public static final TransportVersion SEARCH_INCREMENTAL_TOP_DOCS_NULL_BACKPORT_8_19 = def(8_841_0_20);
public static final TransportVersion ML_INFERENCE_SAGEMAKER_8_19 = def(8_841_0_21);
public static final TransportVersion ESQL_REPORT_ORIGINAL_TYPES_BACKPORT_8_19 = def(8_841_0_22);
public static final TransportVersion PINNED_RETRIEVER_8_19 = def(8_841_0_23);
public static final TransportVersion ESQL_AGGREGATE_METRIC_DOUBLE_BLOCK_8_19 = def(8_841_0_24);
public static final TransportVersion INTRODUCE_FAILURES_LIFECYCLE_BACKPORT_8_19 = def(8_841_0_25);
public static final TransportVersion INTRODUCE_FAILURES_DEFAULT_RETENTION_BACKPORT_8_19 = def(8_841_0_26);
public static final TransportVersion RESCORE_VECTOR_ALLOW_ZERO_BACKPORT_8_19 = def(8_841_0_27);
public static final TransportVersion INFERENCE_ADD_TIMEOUT_PUT_ENDPOINT_8_19 = def(8_841_0_28);
public static final TransportVersion ESQL_REPORT_SHARD_PARTITIONING_8_19 = def(8_841_0_29);
public static final TransportVersion ESQL_DRIVER_TASK_DESCRIPTION_8_19 = def(8_841_0_30);

/*
* STOP! READ THIS FIRST! No, really,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ public enum ManagedBy {

public static final ParseField DATA_STREAMS_FIELD = new ParseField("data_streams");

private static final TransportVersion INTRODUCE_FAILURES_DEFAULT_RETENTION = TransportVersion.fromName(
"introduce_failures_default_retention"
);
private static final TransportVersion INCLUDE_INDEX_MODE_IN_GET_DATA_STREAM = TransportVersion.fromName(
"include_index_mode_in_get_data_stream"
);
Expand Down Expand Up @@ -649,7 +652,7 @@ public static Response read(StreamInput in) throws IOException {
: null;
DataStreamGlobalRetention dataGlobalRetention = null;
DataStreamGlobalRetention failuresGlobalRetention = null;
if (in.getTransportVersion().onOrAfter(TransportVersions.INTRODUCE_FAILURES_DEFAULT_RETENTION_BACKPORT_8_19)) {
if (in.getTransportVersion().supports(INTRODUCE_FAILURES_DEFAULT_RETENTION)) {
var defaultRetention = in.readOptionalTimeValue();
var maxRetention = in.readOptionalTimeValue();
var failuresDefaultRetention = in.readOptionalTimeValue();
Expand Down Expand Up @@ -688,7 +691,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalWriteable(rolloverConfiguration);
}
// A version 9.x cluster will never read this, so we only need to include the patch version here.
if (out.getTransportVersion().isPatchFrom(TransportVersions.INTRODUCE_FAILURES_DEFAULT_RETENTION_BACKPORT_8_19)) {
if (out.getTransportVersion().supports(INTRODUCE_FAILURES_DEFAULT_RETENTION)) {
out.writeOptionalTimeValue(dataGlobalRetention == null ? null : dataGlobalRetention.defaultRetention());
out.writeOptionalTimeValue(dataGlobalRetention == null ? null : dataGlobalRetention.maxRetention());
out.writeOptionalTimeValue(failuresGlobalRetention == null ? null : failuresGlobalRetention.defaultRetention());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

package org.elasticsearch.action.datastreams.lifecycle;

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse;
Expand Down Expand Up @@ -143,6 +144,10 @@ public Request indicesOptions(IndicesOptions indicesOptions) {
*/
public static class Response extends ActionResponse implements ChunkedToXContentObject {
public static final ParseField INDICES_FIELD = new ParseField("indices");
private static final TransportVersion INTRODUCE_FAILURES_DEFAULT_RETENTION = TransportVersion.fromName(
"" + "introduce_failures_default_retention"
);

private final List<ExplainIndexDataStreamLifecycle> indices;
@Nullable
private final RolloverConfiguration rolloverConfiguration;
Expand All @@ -167,7 +172,7 @@ public Response(StreamInput in) throws IOException {
super(in);
this.indices = in.readCollectionAsList(ExplainIndexDataStreamLifecycle::new);
this.rolloverConfiguration = in.readOptionalWriteable(RolloverConfiguration::new);
if (in.getTransportVersion().onOrAfter(TransportVersions.INTRODUCE_FAILURES_DEFAULT_RETENTION_BACKPORT_8_19)) {
if (in.getTransportVersion().supports(INTRODUCE_FAILURES_DEFAULT_RETENTION)) {
var defaultRetention = in.readOptionalTimeValue();
var maxRetention = in.readOptionalTimeValue();
var defaultFailuresRetention = in.readOptionalTimeValue();
Expand Down Expand Up @@ -209,7 +214,7 @@ private DataStreamGlobalRetention getGlobalRetentionForLifecycle(DataStreamLifec
public void writeTo(StreamOutput out) throws IOException {
out.writeCollection(indices);
out.writeOptionalWriteable(rolloverConfiguration);
if (out.getTransportVersion().onOrAfter(TransportVersions.INTRODUCE_FAILURES_DEFAULT_RETENTION_BACKPORT_8_19)) {
if (out.getTransportVersion().supports(INTRODUCE_FAILURES_DEFAULT_RETENTION)) {
out.writeOptionalTimeValue(dataGlobalRetention == null ? null : dataGlobalRetention.defaultRetention());
out.writeOptionalTimeValue(dataGlobalRetention == null ? null : dataGlobalRetention.maxRetention());
out.writeOptionalTimeValue(failureGlobalRetention == null ? null : failureGlobalRetention.defaultRetention());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TopFieldDocs;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.IndicesRequest;
Expand Down Expand Up @@ -79,6 +79,8 @@ public class SearchQueryThenFetchAsyncAction extends AbstractSearchAsyncAction<S

private static final Logger logger = LogManager.getLogger(SearchQueryThenFetchAsyncAction.class);

private static final TransportVersion BATCHED_QUERY_PHASE_VERSION = TransportVersion.fromName("batched_query_phase_version");

private final SearchProgressListener progressListener;

// informations to track the best bottom top doc globally.
Expand Down Expand Up @@ -473,7 +475,7 @@ protected void doRun(Map<SearchShardIterator, Integer> shardIndexMap) {
return;
}
// must check both node and transport versions to correctly deal with BwC on proxy connections
if (connection.getTransportVersion().before(TransportVersions.BATCHED_QUERY_PHASE_VERSION_BACKPORT_8_X)
if (connection.getTransportVersion().supports(BATCHED_QUERY_PHASE_VERSION) == false
|| connection.getNode().getVersionInformation().nodeVersion().before(Version.V_8_19_0)) {
executeWithoutBatching(routing, request);
return;
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 All @@ -30,6 +30,8 @@ public enum IndexComponentSelector implements Writeable {
DATA("data", (byte) 0),
FAILURES("failures", (byte) 1);

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

private final String key;
private final byte id;

Expand Down Expand Up @@ -92,8 +94,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_BACKPORT_8_19)
|| in.getTransportVersion().isPatchFrom(TransportVersions.REMOVE_ALL_APPLICABLE_SELECTOR_BACKPORT_8_18)) {
if (in.getTransportVersion().supports(REMOVE_ALL_APPLICABLE_SELECTOR)) {
return getById(id);
} else {
// Legacy value ::*, converted to ::data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

package org.elasticsearch.cluster.metadata;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.cluster.Diff;
import org.elasticsearch.cluster.SimpleDiffable;
import org.elasticsearch.common.Strings;
Expand Down Expand Up @@ -59,6 +59,8 @@ public record DataStreamFailureStore(@Nullable Boolean enabled, @Nullable DataSt
);
}

private static final TransportVersion INTRODUCE_FAILURES_LIFECYCLE = TransportVersion.fromName("introduce_failures_lifecycle");

/**
* @param enabled, true when the failure is enabled, false when it's disabled, null when it depends on other configuration. Currently,
* null value is not supported because there are no other arguments
Expand All @@ -74,9 +76,7 @@ public record DataStreamFailureStore(@Nullable Boolean enabled, @Nullable DataSt
public DataStreamFailureStore(StreamInput in) throws IOException {
this(
in.readOptionalBoolean(),
in.getTransportVersion().onOrAfter(TransportVersions.INTRODUCE_FAILURES_LIFECYCLE_BACKPORT_8_19)
? in.readOptionalWriteable(DataStreamLifecycle::new)
: null
in.getTransportVersion().supports(INTRODUCE_FAILURES_LIFECYCLE) ? in.readOptionalWriteable(DataStreamLifecycle::new) : null
);
}

Expand All @@ -87,7 +87,7 @@ public static Diff<DataStreamFailureStore> readDiffFrom(StreamInput in) throws I
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalBoolean(enabled);
if (out.getTransportVersion().onOrAfter(TransportVersions.INTRODUCE_FAILURES_LIFECYCLE_BACKPORT_8_19)) {
if (out.getTransportVersion().supports(INTRODUCE_FAILURES_LIFECYCLE)) {
out.writeOptionalWriteable(lifecycle);
}
}
Expand Down Expand Up @@ -167,15 +167,15 @@ public Template(@Nullable Boolean enabled, @Nullable DataStreamLifecycle.Templat
@Override
public void writeTo(StreamOutput out) throws IOException {
ResettableValue.write(out, enabled, StreamOutput::writeBoolean);
if (out.getTransportVersion().onOrAfter(TransportVersions.INTRODUCE_FAILURES_LIFECYCLE_BACKPORT_8_19)) {
if (out.getTransportVersion().supports(INTRODUCE_FAILURES_LIFECYCLE)) {
ResettableValue.write(out, lifecycle, (o, v) -> v.writeTo(o));
}
}

public static Template read(StreamInput in) throws IOException {
ResettableValue<Boolean> enabled = ResettableValue.read(in, StreamInput::readBoolean);
ResettableValue<DataStreamLifecycle.Template> lifecycle = ResettableValue.undefined();
if (in.getTransportVersion().onOrAfter(TransportVersions.INTRODUCE_FAILURES_LIFECYCLE_BACKPORT_8_19)) {
if (in.getTransportVersion().supports(INTRODUCE_FAILURES_LIFECYCLE)) {
lifecycle = ResettableValue.read(in, DataStreamLifecycle.Template::read);
}
return new Template(enabled, lifecycle);
Expand Down
Loading