Remove LegacyESVersion.V_6_6_x constants (#1804)

This commit removes all usages of the `LegacyESVersion.V_6_6_x` constants from the codebase.

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
This commit is contained in:
Rabi Panda 2021-12-29 22:43:53 -08:00 committed by GitHub
parent d843ddd9c0
commit 5ccb22fb4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 47 additions and 171 deletions

View File

@ -46,9 +46,6 @@ import java.lang.reflect.Field;
*/
public class LegacyESVersion extends Version {
public static final LegacyESVersion V_6_6_0 = new LegacyESVersion(6060099, org.apache.lucene.util.Version.LUCENE_7_6_0);
public static final LegacyESVersion V_6_6_1 = new LegacyESVersion(6060199, org.apache.lucene.util.Version.LUCENE_7_6_0);
public static final LegacyESVersion V_6_6_2 = new LegacyESVersion(6060299, org.apache.lucene.util.Version.LUCENE_7_6_0);
public static final LegacyESVersion V_6_7_0 = new LegacyESVersion(6070099, org.apache.lucene.util.Version.LUCENE_7_7_0);
public static final LegacyESVersion V_6_7_1 = new LegacyESVersion(6070199, org.apache.lucene.util.Version.LUCENE_7_7_0);
public static final LegacyESVersion V_6_7_2 = new LegacyESVersion(6070299, org.apache.lucene.util.Version.LUCENE_7_7_0);

View File

@ -32,7 +32,6 @@
package org.opensearch.action.admin.cluster.state;
import org.opensearch.LegacyESVersion;
import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.action.IndicesRequest;
import org.opensearch.action.support.IndicesOptions;
@ -69,10 +68,8 @@ public class ClusterStateRequest extends MasterNodeReadRequest<ClusterStateReque
customs = in.readBoolean();
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
if (in.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
waitForTimeout = in.readTimeValue();
waitForMetadataVersion = in.readOptionalLong();
}
waitForTimeout = in.readTimeValue();
waitForMetadataVersion = in.readOptionalLong();
}
@Override
@ -85,10 +82,8 @@ public class ClusterStateRequest extends MasterNodeReadRequest<ClusterStateReque
out.writeBoolean(customs);
out.writeStringArray(indices);
indicesOptions.writeIndicesOptions(out);
if (out.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
out.writeTimeValue(waitForTimeout);
out.writeOptionalLong(waitForMetadataVersion);
}
out.writeTimeValue(waitForTimeout);
out.writeOptionalLong(waitForMetadataVersion);
}
@Override

View File

@ -56,17 +56,11 @@ public class ClusterStateResponse extends ActionResponse {
public ClusterStateResponse(StreamInput in) throws IOException {
super(in);
clusterName = new ClusterName(in);
if (in.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
clusterState = in.readOptionalWriteable(innerIn -> ClusterState.readFrom(innerIn, null));
} else {
clusterState = ClusterState.readFrom(in, null);
}
clusterState = in.readOptionalWriteable(innerIn -> ClusterState.readFrom(innerIn, null));
if (in.getVersion().before(LegacyESVersion.V_7_0_0)) {
new ByteSizeValue(in);
}
if (in.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
waitForTimedOut = in.readBoolean();
}
waitForTimedOut = in.readBoolean();
}
public ClusterStateResponse(ClusterName clusterName, ClusterState clusterState, boolean waitForTimedOut) {
@ -101,17 +95,11 @@ public class ClusterStateResponse extends ActionResponse {
@Override
public void writeTo(StreamOutput out) throws IOException {
clusterName.writeTo(out);
if (out.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
out.writeOptionalWriteable(clusterState);
} else {
clusterState.writeTo(out);
}
out.writeOptionalWriteable(clusterState);
if (out.getVersion().before(LegacyESVersion.V_7_0_0)) {
ByteSizeValue.ZERO.writeTo(out);
}
if (out.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
out.writeBoolean(waitForTimedOut);
}
out.writeBoolean(waitForTimedOut);
}
@Override

View File

@ -97,13 +97,8 @@ public class DeleteRequest extends ReplicatedWriteRequest<DeleteRequest>
}
version = in.readLong();
versionType = VersionType.fromValue(in.readByte());
if (in.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
ifSeqNo = in.readZLong();
ifPrimaryTerm = in.readVLong();
} else {
ifSeqNo = UNASSIGNED_SEQ_NO;
ifPrimaryTerm = UNASSIGNED_PRIMARY_TERM;
}
ifSeqNo = in.readZLong();
ifPrimaryTerm = in.readVLong();
}
public DeleteRequest() {
@ -348,18 +343,8 @@ public class DeleteRequest extends ReplicatedWriteRequest<DeleteRequest>
}
out.writeLong(version);
out.writeByte(versionType.getValue());
if (out.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
out.writeZLong(ifSeqNo);
out.writeVLong(ifPrimaryTerm);
} else if (ifSeqNo != UNASSIGNED_SEQ_NO || ifPrimaryTerm != UNASSIGNED_PRIMARY_TERM) {
assert false : "setIfMatch [" + ifSeqNo + "], currentDocTem [" + ifPrimaryTerm + "]";
throw new IllegalStateException(
"sequence number based compare and write is not supported until all nodes are on version 7.0 or higher. "
+ "Stream version ["
+ out.getVersion()
+ "]"
);
}
out.writeZLong(ifSeqNo);
out.writeVLong(ifPrimaryTerm);
}
@Override

View File

@ -167,13 +167,8 @@ public class IndexRequest extends ReplicatedWriteRequest<IndexRequest> implement
} else {
contentType = null;
}
if (in.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
ifSeqNo = in.readZLong();
ifPrimaryTerm = in.readVLong();
} else {
ifSeqNo = UNASSIGNED_SEQ_NO;
ifPrimaryTerm = UNASSIGNED_PRIMARY_TERM;
}
ifSeqNo = in.readZLong();
ifPrimaryTerm = in.readVLong();
if (in.getVersion().onOrAfter(LegacyESVersion.V_7_10_0)) {
requireAlias = in.readBoolean();
} else {
@ -765,18 +760,8 @@ public class IndexRequest extends ReplicatedWriteRequest<IndexRequest> implement
} else {
out.writeBoolean(false);
}
if (out.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
out.writeZLong(ifSeqNo);
out.writeVLong(ifPrimaryTerm);
} else if (ifSeqNo != UNASSIGNED_SEQ_NO || ifPrimaryTerm != UNASSIGNED_PRIMARY_TERM) {
assert false : "setIfMatch [" + ifSeqNo + "], currentDocTem [" + ifPrimaryTerm + "]";
throw new IllegalStateException(
"sequence number based compare and write is not supported until all nodes are on version 7.0 or higher. "
+ "Stream version ["
+ out.getVersion()
+ "]"
);
}
out.writeZLong(ifSeqNo);
out.writeVLong(ifPrimaryTerm);
if (out.getVersion().onOrAfter(LegacyESVersion.V_7_10_0)) {
out.writeBoolean(requireAlias);
}

View File

@ -263,11 +263,6 @@ public class IndicesOptions implements ToXContentFragment {
public void writeIndicesOptions(StreamOutput out) throws IOException {
EnumSet<Option> options = this.options;
// never write this out to a pre 6.6 version
if (out.getVersion().before(LegacyESVersion.V_6_6_0) && options.contains(Option.IGNORE_THROTTLED)) {
options = EnumSet.copyOf(options);
options.remove(Option.IGNORE_THROTTLED);
}
out.writeEnumSet(options);
if (out.getVersion().before(LegacyESVersion.V_7_7_0) && expandWildcards.contains(WildcardStates.HIDDEN)) {
final EnumSet<WildcardStates> states = EnumSet.copyOf(expandWildcards);

View File

@ -34,7 +34,6 @@ package org.opensearch.cluster;
import com.carrotsearch.hppc.cursors.ObjectCursor;
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
import org.opensearch.LegacyESVersion;
import org.opensearch.Version;
import org.opensearch.cluster.ClusterState.Custom;
import org.opensearch.common.collect.ImmutableOpenMap;
@ -451,11 +450,7 @@ public class RestoreInProgress extends AbstractNamedDiffable<Custom> implements
final ImmutableOpenMap.Builder<String, Entry> entriesBuilder = ImmutableOpenMap.builder(count);
for (int i = 0; i < count; i++) {
final String uuid;
if (in.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
uuid = in.readString();
} else {
uuid = BWC_UUID;
}
uuid = in.readString();
Snapshot snapshot = new Snapshot(in);
State state = State.fromValue(in.readByte());
List<String> indexBuilder = in.readStringList();
@ -478,9 +473,7 @@ public class RestoreInProgress extends AbstractNamedDiffable<Custom> implements
out.writeVInt(entries.size());
for (ObjectCursor<Entry> v : entries.values()) {
Entry entry = v.value;
if (out.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
out.writeString(entry.uuid);
}
out.writeString(entry.uuid);
entry.snapshot().writeTo(out);
out.writeByte(entry.state().value());
out.writeStringCollection(entry.indices);

View File

@ -33,7 +33,6 @@ package org.opensearch.cluster.coordination;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.LegacyESVersion;
import org.opensearch.cluster.ClusterState;
import org.opensearch.cluster.coordination.CoordinationMetadata.VotingConfiguration;
import org.opensearch.cluster.coordination.CoordinationState.VoteCollection;
@ -197,9 +196,6 @@ public class ClusterFormationFailureHelper {
}
if (clusterState.getLastAcceptedConfiguration().isEmpty()) {
// TODO handle the case that there is a 6.x node around here, when rolling upgrades are supported
final String bootstrappingDescription;
if (INITIAL_MASTER_NODES_SETTING.get(Settings.EMPTY).equals(INITIAL_MASTER_NODES_SETTING.get(settings))) {
@ -214,8 +210,7 @@ public class ClusterFormationFailureHelper {
return String.format(
Locale.ROOT,
"master not discovered yet, this node has not previously joined a bootstrapped (v%d+) cluster, and %s: %s",
LegacyESVersion.V_6_6_0.major + 1,
"master not discovered yet, this node has not previously joined a bootstrapped cluster, and %s: %s",
bootstrappingDescription,
discoveryStateIgnoringQuorum
);

View File

@ -34,7 +34,6 @@ package org.opensearch.cluster.routing;
import org.opensearch.LegacyESVersion;
import org.opensearch.Version;
import org.opensearch.cluster.RestoreInProgress;
import org.opensearch.cluster.metadata.IndexMetadata;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
@ -249,11 +248,7 @@ public abstract class RecoverySource implements Writeable, ToXContentObject {
}
SnapshotRecoverySource(StreamInput in) throws IOException {
if (in.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
restoreUUID = in.readString();
} else {
restoreUUID = RestoreInProgress.BWC_UUID;
}
restoreUUID = in.readString();
snapshot = new Snapshot(in);
version = Version.readVersion(in);
if (in.getVersion().onOrAfter(LegacyESVersion.V_7_7_0)) {
@ -287,9 +282,7 @@ public abstract class RecoverySource implements Writeable, ToXContentObject {
@Override
protected void writeAdditionalFields(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
out.writeString(restoreUUID);
}
out.writeString(restoreUUID);
snapshot.writeTo(out);
Version.writeVersion(version, out);
if (out.getVersion().onOrAfter(LegacyESVersion.V_7_7_0)) {

View File

@ -90,13 +90,8 @@ public class GetResult implements Writeable, Iterable<DocumentField>, ToXContent
index = in.readString();
type = in.readOptionalString();
id = in.readString();
if (in.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
seqNo = in.readZLong();
primaryTerm = in.readVLong();
} else {
seqNo = UNASSIGNED_SEQ_NO;
primaryTerm = UNASSIGNED_PRIMARY_TERM;
}
seqNo = in.readZLong();
primaryTerm = in.readVLong();
version = in.readLong();
exists = in.readBoolean();
if (exists) {
@ -449,10 +444,8 @@ public class GetResult implements Writeable, Iterable<DocumentField>, ToXContent
out.writeString(index);
out.writeOptionalString(type);
out.writeString(id);
if (out.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
out.writeZLong(seqNo);
out.writeVLong(primaryTerm);
}
out.writeZLong(seqNo);
out.writeVLong(primaryTerm);
out.writeLong(version);
out.writeBoolean(exists);
if (exists) {

View File

@ -32,7 +32,6 @@
package org.opensearch.index.mapper;
import org.apache.lucene.document.FieldType;
import org.opensearch.LegacyESVersion;
import org.opensearch.common.Explicit;
import org.opensearch.common.ParseField;
import org.opensearch.common.geo.builders.ShapeBuilder;
@ -161,7 +160,7 @@ public abstract class AbstractShapeGeometryFieldMapper<Parsed, Processed> extend
iterator.remove();
}
}
if (parserContext.indexVersionCreated().onOrAfter(LegacyESVersion.V_6_6_0) && parsedDeprecatedParameters == false) {
if (parsedDeprecatedParameters == false) {
params.remove(DEPRECATED_PARAMETERS_KEY);
}

View File

@ -220,8 +220,6 @@ public class LegacyGeoShapeFieldMapper extends AbstractShapeGeometryFieldMapper<
}
if (deprecatedParameters.tree != null) {
ft.setTree(deprecatedParameters.tree);
} else if (context.indexCreatedVersion().before(LegacyESVersion.V_6_6_0)) {
ft.setTree(DeprecatedParameters.PrefixTrees.GEOHASH);
}
if (deprecatedParameters.treeLevels != null) {
ft.setTreeLevels(deprecatedParameters.treeLevels);
@ -517,13 +515,7 @@ public class LegacyGeoShapeFieldMapper extends AbstractShapeGeometryFieldMapper<
public void doXContentBody(XContentBuilder builder, boolean includeDefaults, Params params) throws IOException {
super.doXContentBody(builder, includeDefaults, params);
if (includeDefaults
|| (fieldType().tree()
.equals(
indexCreatedVersion.onOrAfter(LegacyESVersion.V_6_6_0)
? DeprecatedParameters.Defaults.TREE
: DeprecatedParameters.PrefixTrees.GEOHASH
)) == false) {
if (includeDefaults || (fieldType().tree().equals(DeprecatedParameters.Defaults.TREE)) == false) {
builder.field(DeprecatedParameters.Names.TREE.getPreferredName(), fieldType().tree());
}

View File

@ -32,7 +32,6 @@
package org.opensearch.monitor.os;
import org.opensearch.LegacyESVersion;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
import org.opensearch.common.unit.TimeValue;
@ -74,11 +73,7 @@ public class OsInfo implements ReportingService.Info {
this.availableProcessors = in.readInt();
this.allocatedProcessors = in.readInt();
this.name = in.readOptionalString();
if (in.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
this.prettyName = in.readOptionalString();
} else {
this.prettyName = null;
}
this.prettyName = in.readOptionalString();
this.arch = in.readOptionalString();
this.version = in.readOptionalString();
}
@ -89,9 +84,7 @@ public class OsInfo implements ReportingService.Info {
out.writeInt(availableProcessors);
out.writeInt(allocatedProcessors);
out.writeOptionalString(name);
if (out.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
out.writeOptionalString(prettyName);
}
out.writeOptionalString(prettyName);
out.writeOptionalString(arch);
out.writeOptionalString(version);
}

View File

@ -35,7 +35,6 @@ package org.opensearch.search;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.TotalHits;
import org.apache.lucene.search.TotalHits.Relation;
import org.opensearch.LegacyESVersion;
import org.opensearch.common.Nullable;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
@ -113,15 +112,9 @@ public final class SearchHits implements Writeable, ToXContentFragment, Iterable
hits[i] = new SearchHit(in);
}
}
if (in.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
sortFields = in.readOptionalArray(Lucene::readSortField, SortField[]::new);
collapseField = in.readOptionalString();
collapseValues = in.readOptionalArray(Lucene::readSortValue, Object[]::new);
} else {
sortFields = null;
collapseField = null;
collapseValues = null;
}
sortFields = in.readOptionalArray(Lucene::readSortField, SortField[]::new);
collapseField = in.readOptionalString();
collapseValues = in.readOptionalArray(Lucene::readSortValue, Object[]::new);
}
@Override
@ -138,11 +131,9 @@ public final class SearchHits implements Writeable, ToXContentFragment, Iterable
hit.writeTo(out);
}
}
if (out.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
out.writeOptionalArray(Lucene::writeSortField, sortFields);
out.writeOptionalString(collapseField);
out.writeOptionalArray(Lucene::writeSortValue, collapseValues);
}
out.writeOptionalArray(Lucene::writeSortField, sortFields);
out.writeOptionalString(collapseField);
out.writeOptionalArray(Lucene::writeSortValue, collapseValues);
}
/**

View File

@ -33,7 +33,6 @@
package org.opensearch.search;
import org.apache.lucene.util.BytesRef;
import org.opensearch.LegacyESVersion;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
import org.opensearch.common.io.stream.Writeable;
@ -83,19 +82,13 @@ public class SearchSortValues implements ToXContentFragment, Writeable {
SearchSortValues(StreamInput in) throws IOException {
this.formattedSortValues = in.readArray(Lucene::readSortValue, Object[]::new);
if (in.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
this.rawSortValues = in.readArray(Lucene::readSortValue, Object[]::new);
} else {
this.rawSortValues = EMPTY_ARRAY;
}
this.rawSortValues = in.readArray(Lucene::readSortValue, Object[]::new);
}
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeArray(Lucene::writeSortValue, this.formattedSortValues);
if (out.getVersion().onOrAfter(LegacyESVersion.V_6_6_0)) {
out.writeArray(Lucene::writeSortValue, this.rawSortValues);
}
out.writeArray(Lucene::writeSortValue, this.rawSortValues);
}
@Override

View File

@ -300,9 +300,7 @@ public class BuildTests extends OpenSearchTestCase {
);
final List<Version> versions = Version.getDeclaredVersions(LegacyESVersion.class);
final Version post63Pre67Version = randomFrom(
versions.stream().filter(v -> v.before(LegacyESVersion.V_6_7_0)).collect(Collectors.toList())
);
final Version post67Pre70Version = randomFrom(
versions.stream()
.filter(v -> v.onOrAfter(LegacyESVersion.V_6_7_0) && v.before(LegacyESVersion.V_7_0_0))
@ -315,7 +313,6 @@ public class BuildTests extends OpenSearchTestCase {
versions.stream().filter(v -> v.onOrAfter(Version.V_1_0_0)).collect(Collectors.toList())
);
final WriteableBuild post63pre67 = copyWriteable(dockerBuild, writableRegistry(), WriteableBuild::new, post63Pre67Version);
final WriteableBuild post67pre70 = copyWriteable(dockerBuild, writableRegistry(), WriteableBuild::new, post67Pre70Version);
final WriteableBuild post70 = copyWriteable(dockerBuild, writableRegistry(), WriteableBuild::new, post70Version);
final WriteableBuild post10OpenSearch = copyWriteable(
@ -325,11 +322,9 @@ public class BuildTests extends OpenSearchTestCase {
post10OpenSearchVersion
);
assertThat(post63pre67.build.type(), equalTo(Build.Type.TAR));
assertThat(post67pre70.build.type(), equalTo(dockerBuild.build.type()));
assertThat(post70.build.type(), equalTo(dockerBuild.build.type()));
assertThat(post63pre67.build.getQualifiedVersion(), equalTo(post63Pre67Version.toString()));
assertThat(post67pre70.build.getQualifiedVersion(), equalTo(post67Pre70Version.toString()));
assertThat(post70.build.getQualifiedVersion(), equalTo(dockerBuild.build.getQualifiedVersion()));
assertThat(post70.build.getDistribution(), equalTo(dockerBuild.build.getDistribution()));

View File

@ -281,7 +281,7 @@ public class LegacyESVersionTests extends OpenSearchTestCase {
public void testIsCompatible() {
assertTrue(isCompatible(LegacyESVersion.V_6_8_0, LegacyESVersion.V_7_0_0));
assertFalse(isCompatible(LegacyESVersion.V_6_6_0, LegacyESVersion.V_7_0_0));
assertFalse(isCompatible(LegacyESVersion.fromString("6.6.0"), LegacyESVersion.V_7_0_0));
assertFalse(isCompatible(LegacyESVersion.V_6_7_0, LegacyESVersion.V_7_0_0));
assertFalse(isCompatible(LegacyESVersion.fromId(5000099), LegacyESVersion.fromString("6.0.0")));

View File

@ -88,10 +88,8 @@ public class ClusterStateRequestTests extends OpenSearchTestCase {
assertThat(deserializedCSRequest.blocks(), equalTo(clusterStateRequest.blocks()));
assertThat(deserializedCSRequest.indices(), equalTo(clusterStateRequest.indices()));
assertOptionsMatch(deserializedCSRequest.indicesOptions(), clusterStateRequest.indicesOptions());
if (testVersion.onOrAfter(LegacyESVersion.V_6_6_0)) {
assertThat(deserializedCSRequest.waitForMetadataVersion(), equalTo(clusterStateRequest.waitForMetadataVersion()));
assertThat(deserializedCSRequest.waitForTimeout(), equalTo(clusterStateRequest.waitForTimeout()));
}
assertThat(deserializedCSRequest.waitForMetadataVersion(), equalTo(clusterStateRequest.waitForMetadataVersion()));
assertThat(deserializedCSRequest.waitForTimeout(), equalTo(clusterStateRequest.waitForTimeout()));
}
}

View File

@ -328,7 +328,7 @@ public class ClusterFormationFailureHelperTests extends OpenSearchTestCase {
new StatusInfo(HEALTHY, "healthy-info")
).getDescription(),
is(
"master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and "
"master not discovered yet, this node has not previously joined a bootstrapped cluster, and "
+ "[cluster.initial_master_nodes] is empty on this node: have discovered []; "
+ "discovery will continue using [] from hosts providers and ["
+ localNode
@ -348,7 +348,7 @@ public class ClusterFormationFailureHelperTests extends OpenSearchTestCase {
new StatusInfo(HEALTHY, "healthy-info")
).getDescription(),
is(
"master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and "
"master not discovered yet, this node has not previously joined a bootstrapped cluster, and "
+ "[cluster.initial_master_nodes] is empty on this node: have discovered []; "
+ "discovery will continue using ["
+ otherAddress
@ -370,7 +370,7 @@ public class ClusterFormationFailureHelperTests extends OpenSearchTestCase {
new StatusInfo(HEALTHY, "healthy-info")
).getDescription(),
is(
"master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and "
"master not discovered yet, this node has not previously joined a bootstrapped cluster, and "
+ "[cluster.initial_master_nodes] is empty on this node: have discovered ["
+ otherNode
+ "]; "
@ -391,7 +391,7 @@ public class ClusterFormationFailureHelperTests extends OpenSearchTestCase {
new StatusInfo(HEALTHY, "healthy-info")
).getDescription(),
is(
"master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and "
"master not discovered yet, this node has not previously joined a bootstrapped cluster, and "
+ "this node must discover master-eligible nodes [other] to bootstrap a cluster: have discovered []; "
+ "discovery will continue using [] from hosts providers and ["
+ localNode

View File

@ -33,7 +33,6 @@
package org.opensearch.index.mapper;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.opensearch.LegacyESVersion;
import org.opensearch.common.collect.Iterators;
import org.opensearch.common.geo.GeoPoint;
import org.opensearch.common.geo.builders.PointBuilder;
@ -102,9 +101,7 @@ public class ExternalMapper extends ParametrizedFieldMapper {
BinaryFieldMapper binMapper = binBuilder.build(context);
BooleanFieldMapper boolMapper = boolBuilder.build(context);
GeoPointFieldMapper pointMapper = (GeoPointFieldMapper) latLonPointBuilder.build(context);
AbstractShapeGeometryFieldMapper<?, ?> shapeMapper = (context.indexCreatedVersion().before(LegacyESVersion.V_6_6_0))
? legacyShapeBuilder.build(context)
: shapeBuilder.build(context);
AbstractShapeGeometryFieldMapper<?, ?> shapeMapper = shapeBuilder.build(context);
FieldMapper stringMapper = (FieldMapper) stringBuilder.build(context);
context.path().remove();

View File

@ -35,7 +35,6 @@ import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.ConstantScoreQuery;
import org.apache.lucene.search.MatchNoDocsQuery;
import org.apache.lucene.search.Query;
import org.opensearch.LegacyESVersion;
import org.opensearch.OpenSearchException;
import org.opensearch.Version;
import org.opensearch.action.get.GetRequest;
@ -82,7 +81,7 @@ public abstract class GeoShapeQueryBuilderTests extends AbstractQueryTestCase<Ge
@Override
protected Settings createTestIndexSettings() {
// force the new shape impl
Version version = VersionUtils.randomVersionBetween(random(), LegacyESVersion.V_6_6_0, Version.CURRENT);
Version version = VersionUtils.randomIndexCompatibleVersion(random());
return Settings.builder().put(super.createTestIndexSettings()).put(IndexMetadata.SETTING_VERSION_CREATED, version).build();
}