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
2 changes: 0 additions & 2 deletions server/src/main/java/org/elasticsearch/TransportVersions.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ static TransportVersion def(int id) {
public static final TransportVersion V_7_8_1 = def(7_08_01_99);
public static final TransportVersion V_7_9_0 = def(7_09_00_99);
public static final TransportVersion V_7_10_0 = def(7_10_00_99);
public static final TransportVersion V_7_11_0 = def(7_11_00_99);
public static final TransportVersion V_7_12_0 = def(7_12_00_99);
public static final TransportVersion V_7_13_0 = def(7_13_00_99);
public static final TransportVersion V_7_14_0 = def(7_14_00_99);
public static final TransportVersion V_7_15_0 = def(7_15_00_99);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ public CreateIndexRequest(StreamInput in) throws IOException {
aliases.add(new Alias(in));
}
waitForActiveShards = ActiveShardCount.readFrom(in);
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_12_0)) {
origin = in.readString();
}
origin = in.readString();
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_13_0)) {
requireDataStream = in.readBoolean();
} else {
Expand Down Expand Up @@ -518,9 +516,7 @@ public void writeTo(StreamOutput out) throws IOException {
}
out.writeCollection(aliases);
waitForActiveShards.writeTo(out);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_12_0)) {
out.writeString(origin);
}
out.writeString(origin);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_13_0)) {
out.writeBoolean(this.requireDataStream);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,7 @@ public long pendingGeneration() {

public RepositoryMetadata(StreamInput in) throws IOException {
name = in.readString();
if (in.getTransportVersion().onOrAfter(SnapshotsService.UUIDS_IN_REPO_DATA_TRANSPORT_VERSION)) {
uuid = in.readString();
} else {
uuid = RepositoryData.MISSING_UUID;
}
uuid = in.readString();
type = in.readString();
settings = Settings.readSettingsFromStream(in);
generation = in.readLong();
Expand All @@ -162,9 +158,7 @@ public RepositoryMetadata(StreamInput in) throws IOException {
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeString(name);
if (out.getTransportVersion().onOrAfter(SnapshotsService.UUIDS_IN_REPO_DATA_TRANSPORT_VERSION)) {
out.writeString(uuid);
}
out.writeString(uuid);
out.writeString(type);
settings.writeTo(out);
out.writeLong(generation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public class PluginDescriptor implements Writeable, ToXContentObject {

public static final String ES_PLUGIN_POLICY = "plugin-security.policy";

private static final TransportVersion LICENSED_PLUGINS_SUPPORT = TransportVersions.V_7_11_0;
private static final TransportVersion MODULE_NAME_SUPPORT = TransportVersions.V_8_3_0;
private static final TransportVersion BOOTSTRAP_SUPPORT_REMOVED = TransportVersions.V_8_4_0;

Expand Down Expand Up @@ -140,15 +139,11 @@ public PluginDescriptor(final StreamInput in) throws IOException {
extendedPlugins = in.readStringCollectionAsList();
hasNativeController = in.readBoolean();

if (in.getTransportVersion().onOrAfter(LICENSED_PLUGINS_SUPPORT)) {
if (in.getTransportVersion().before(BOOTSTRAP_SUPPORT_REMOVED)) {
in.readString(); // plugin type
in.readOptionalString(); // java opts
}
isLicensed = in.readBoolean();
} else {
isLicensed = false;
if (in.getTransportVersion().before(BOOTSTRAP_SUPPORT_REMOVED)) {
in.readString(); // plugin type
in.readOptionalString(); // java opts
}
isLicensed = in.readBoolean();

if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) {
isModular = in.readBoolean();
Expand Down Expand Up @@ -183,13 +178,11 @@ public void writeTo(final StreamOutput out) throws IOException {
out.writeStringCollection(extendedPlugins);
out.writeBoolean(hasNativeController);

if (out.getTransportVersion().onOrAfter(LICENSED_PLUGINS_SUPPORT)) {
if (out.getTransportVersion().before(BOOTSTRAP_SUPPORT_REMOVED)) {
out.writeString("ISOLATED");
out.writeOptionalString(null);
}
out.writeBoolean(isLicensed);
if (out.getTransportVersion().before(BOOTSTRAP_SUPPORT_REMOVED)) {
out.writeString("ISOLATED");
out.writeOptionalString(null);
}
out.writeBoolean(isLicensed);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) {
out.writeBoolean(isModular);
out.writeBoolean(isStable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionResponse;
Expand Down Expand Up @@ -146,7 +145,6 @@ public final class SnapshotsService extends AbstractLifecycleComponent implement
public static final IndexVersion INDEX_GEN_IN_REPO_DATA_VERSION = IndexVersions.V_7_9_0;

public static final IndexVersion UUIDS_IN_REPO_DATA_VERSION = IndexVersions.V_7_12_0;
public static final TransportVersion UUIDS_IN_REPO_DATA_TRANSPORT_VERSION = TransportVersions.V_7_12_0;

public static final IndexVersion FILE_INFO_WRITER_UUIDS_IN_SHARD_DATA_VERSION = IndexVersions.V_7_16_0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@ private static RescoreVectorBuilder randomRescoreVectorBuilder() {
public void testRandomVersionSerialization() throws IOException {
SearchRequest searchRequest = createSearchRequest();
TransportVersion version = TransportVersionUtils.randomVersion(random());
if (version.before(TransportVersions.V_7_11_0) && searchRequest.source() != null) {
// Versions before 7.11.0 don't support runtime mappings
searchRequest.source().runtimeMappings(emptyMap());
}
if (version.before(TransportVersions.V_8_4_0)) {
// Versions before 8.4.0 don't support force_synthetic_source
searchRequest.setForceSyntheticSource(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package org.elasticsearch.cluster.node;

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.Version;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.BytesStreamOutput;
Expand Down Expand Up @@ -113,24 +112,6 @@ public void testDiscoveryNodeRoleWithOldVersion() throws Exception {
assertThat(role.roleNameAbbreviation(), equalTo("z"));
assertTrue(role.canContainData());
}

{
BytesStreamOutput streamOutput = new BytesStreamOutput();
streamOutput.setTransportVersion(TransportVersions.V_7_11_0);
node.writeTo(streamOutput);

StreamInput in = StreamInput.wrap(streamOutput.bytes().toBytesRef().bytes);
in.setTransportVersion(TransportVersions.V_7_11_0);
DiscoveryNode serialized = new DiscoveryNode(in);
final Set<DiscoveryNodeRole> roles = serialized.getRoles();
assertThat(roles, hasSize(1));
@SuppressWarnings("OptionalGetWithoutIsPresent")
final DiscoveryNodeRole role = roles.stream().findFirst().get();
assertThat(role.roleName(), equalTo("data_custom_role"));
assertThat(role.roleNameAbbreviation(), equalTo("z"));
assertTrue(role.canContainData());
}

}

public void testDiscoveryNodeIsRemoteClusterClientDefault() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,6 @@ public boolean equals(Object obj) {

@Override
public TransportVersion getMinimalSupportedVersion() {
return TransportVersions.V_7_12_0;
return TransportVersions.ZERO;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@ public RateAggregationBuilder(StreamInput in) throws IOException {
} else {
rateUnit = null;
}
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) {
if (in.readBoolean()) {
rateMode = in.readEnum(RateMode.class);
}
if (in.readBoolean()) {
rateMode = in.readEnum(RateMode.class);
}
}

Expand All @@ -107,13 +105,11 @@ protected void innerWriteTo(StreamOutput out) throws IOException {
} else {
out.writeByte((byte) 0);
}
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) {
if (rateMode != null) {
out.writeBoolean(true);
out.writeEnum(rateMode);
} else {
out.writeBoolean(false);
}
if (rateMode != null) {
out.writeBoolean(true);
out.writeEnum(rateMode);
} else {
out.writeBoolean(false);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public AggregateMetricFeatureSetUsage(boolean available, boolean enabled) {

@Override
public TransportVersion getMinimalSupportedVersion() {
return TransportVersions.V_7_11_0;
return TransportVersions.ZERO;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.apache.logging.log4j.Logger;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.cluster.SimpleDiffable;
Expand Down Expand Up @@ -86,8 +85,6 @@
*/
public class DatafeedConfig implements SimpleDiffable<DatafeedConfig>, ToXContentObject {

private static final TransportVersion RUNTIME_MAPPINGS_INTRODUCED = TransportVersions.V_7_11_0;

public static final int DEFAULT_SCROLL_SIZE = 1000;

private static final int SECONDS_IN_MINUTE = 60;
Expand Down Expand Up @@ -341,9 +338,7 @@ public Integer getScrollSize() {
}

public Optional<Tuple<TransportVersion, String>> minRequiredTransportVersion() {
return runtimeMappings.isEmpty()
? Optional.empty()
: Optional.of(Tuple.tuple(RUNTIME_MAPPINGS_INTRODUCED, SearchSourceBuilder.RUNTIME_MAPPINGS_FIELD.getPreferredName()));
return Optional.empty();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public String getWriteableName() {

@Override
public TransportVersion getMinimalSupportedVersion() {
return TransportVersions.V_7_11_0;
return TransportVersions.ZERO;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ public SecurityFeatureSetUsage(StreamInput in) throws IOException {
anonymousUsage = in.readGenericMap();
roleMappingStoreUsage = in.readGenericMap();
fips140Usage = in.readGenericMap();
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) {
operatorPrivilegesUsage = in.readGenericMap();
}
operatorPrivilegesUsage = in.readGenericMap();
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) {
domainsUsage = in.readGenericMap();
}
Expand Down Expand Up @@ -132,9 +130,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeGenericMap(anonymousUsage);
out.writeGenericMap(roleMappingStoreUsage);
out.writeGenericMap(fips140Usage);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) {
out.writeGenericMap(operatorPrivilegesUsage);
}
out.writeGenericMap(operatorPrivilegesUsage);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) {
out.writeGenericMap(domainsUsage);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

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

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand Down Expand Up @@ -45,9 +44,7 @@ public DelegatePkiAuthenticationResponse(StreamInput input) throws IOException {
super(input);
accessToken = input.readString();
expiresIn = input.readTimeValue();
if (input.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) {
authentication = new Authentication(input);
}
authentication = new Authentication(input);
}

public String getAccessToken() {
Expand All @@ -66,9 +63,7 @@ public Authentication getAuthentication() {
public void writeTo(StreamOutput out) throws IOException {
out.writeString(accessToken);
out.writeTimeValue(expiresIn);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) {
authentication.writeTo(out);
}
authentication.writeTo(out);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
package org.elasticsearch.xpack.core.security.action.oidc;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.core.TimeValue;
Expand Down Expand Up @@ -61,8 +60,6 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeString(accessTokenString);
out.writeString(refreshTokenString);
out.writeTimeValue(expiresIn);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) {
authentication.writeTo(out);
}
authentication.writeTo(out);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
package org.elasticsearch.xpack.core.security.action.oidc;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.xcontent.ToXContentObject;
Expand Down Expand Up @@ -62,9 +61,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeString(authenticationRequestUrl);
out.writeString(state);
out.writeString(nonce);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) {
out.writeString(realmName);
}
out.writeString(realmName);
}

public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeString(tokenString);
out.writeString(refreshToken);
out.writeTimeValue(expiresIn);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) {
authentication.writeTo(out);
}
authentication.writeTo(out);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
package org.elasticsearch.xpack.core.security.action.token;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand Down Expand Up @@ -39,9 +38,7 @@ public CreateTokenResponse(StreamInput in) throws IOException {
scope = in.readOptionalString();
refreshToken = in.readOptionalString();
kerberosAuthenticationResponseToken = in.readOptionalString();
if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) {
authentication = new Authentication(in);
}
authentication = new Authentication(in);
}

public CreateTokenResponse(
Expand Down Expand Up @@ -91,9 +88,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalString(scope);
out.writeOptionalString(refreshToken);
out.writeOptionalString(kerberosAuthenticationResponseToken);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) {
authentication.writeTo(out);
}
authentication.writeTo(out);
}

@Override
Expand Down
Loading