Skip to content

Commit 83da48c

Browse files
committed
Remove the 6.7 version constants.
1 parent 0f26c72 commit 83da48c

File tree

21 files changed

+39
-411
lines changed

21 files changed

+39
-411
lines changed

modules/reindex/src/main/java/org/elasticsearch/index/reindex/TransportUpdateByQueryAction.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
package org.elasticsearch.index.reindex;
2121

2222
import org.apache.logging.log4j.Logger;
23-
import org.elasticsearch.Version;
2423
import org.elasticsearch.action.ActionListener;
2524
import org.elasticsearch.action.index.IndexRequest;
2625
import org.elasticsearch.action.support.ActionFilters;
@@ -82,18 +81,13 @@ protected void doExecute(Task task, UpdateByQueryRequest request, ActionListener
8281
*/
8382
static class AsyncIndexBySearchAction extends AbstractAsyncBulkByScrollAction<UpdateByQueryRequest, TransportUpdateByQueryAction> {
8483

85-
private final boolean useSeqNoForCAS;
86-
8784
AsyncIndexBySearchAction(BulkByScrollTask task, Logger logger, ParentTaskAssigningClient client,
8885
ThreadPool threadPool, TransportUpdateByQueryAction action, UpdateByQueryRequest request, ClusterState clusterState,
8986
ActionListener<BulkByScrollResponse> listener) {
9087
super(task,
91-
// not all nodes support sequence number powered optimistic concurrency control, we fall back to version
92-
clusterState.nodes().getMinNodeVersion().onOrAfter(Version.V_6_7_0) == false,
93-
// all nodes support sequence number powered optimistic concurrency control and we can use it
94-
clusterState.nodes().getMinNodeVersion().onOrAfter(Version.V_6_7_0),
88+
// use sequence number powered optimistic concurrency control
89+
false, true,
9590
logger, client, threadPool, action, request, listener);
96-
useSeqNoForCAS = clusterState.nodes().getMinNodeVersion().onOrAfter(Version.V_6_7_0);
9791
}
9892

9993
@Override

server/src/main/java/org/elasticsearch/Build.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,7 @@ public static void writeBuild(Build build, StreamOutput out) throws IOException
254254
out.writeString(build.flavor().displayName());
255255
}
256256
if (out.getVersion().onOrAfter(Version.V_6_3_0)) {
257-
final Type buildType;
258-
if (out.getVersion().before(Version.V_6_7_0) && build.type() == Type.DOCKER) {
259-
buildType = Type.TAR;
260-
} else {
261-
buildType = build.type();
262-
}
257+
final Type buildType = build.type();
263258
out.writeString(buildType.displayName());
264259
}
265260
out.writeString(build.shortHash());

server/src/main/java/org/elasticsearch/ElasticsearchException.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,19 +1010,19 @@ private enum ElasticsearchExceptionHandle {
10101010
COORDINATION_STATE_REJECTED_EXCEPTION(org.elasticsearch.cluster.coordination.CoordinationStateRejectedException.class,
10111011
org.elasticsearch.cluster.coordination.CoordinationStateRejectedException::new, 150, Version.V_7_0_0),
10121012
SNAPSHOT_IN_PROGRESS_EXCEPTION(org.elasticsearch.snapshots.SnapshotInProgressException.class,
1013-
org.elasticsearch.snapshots.SnapshotInProgressException::new, 151, Version.V_6_7_0),
1013+
org.elasticsearch.snapshots.SnapshotInProgressException::new, 151, UNKNOWN_VERSION_ADDED),
10141014
NO_SUCH_REMOTE_CLUSTER_EXCEPTION(org.elasticsearch.transport.NoSuchRemoteClusterException.class,
1015-
org.elasticsearch.transport.NoSuchRemoteClusterException::new, 152, Version.V_6_7_0),
1015+
org.elasticsearch.transport.NoSuchRemoteClusterException::new, 152, UNKNOWN_VERSION_ADDED),
10161016
RETENTION_LEASE_ALREADY_EXISTS_EXCEPTION(
10171017
org.elasticsearch.index.seqno.RetentionLeaseAlreadyExistsException.class,
10181018
org.elasticsearch.index.seqno.RetentionLeaseAlreadyExistsException::new,
10191019
153,
1020-
Version.V_6_7_0),
1020+
UNKNOWN_VERSION_ADDED),
10211021
RETENTION_LEASE_NOT_FOUND_EXCEPTION(
10221022
org.elasticsearch.index.seqno.RetentionLeaseNotFoundException.class,
10231023
org.elasticsearch.index.seqno.RetentionLeaseNotFoundException::new,
10241024
154,
1025-
Version.V_6_7_0);
1025+
UNKNOWN_VERSION_ADDED);
10261026

10271027
final Class<? extends ElasticsearchException> exceptionClass;
10281028
final CheckedFunction<StreamInput, ? extends ElasticsearchException, IOException> constructor;

server/src/main/java/org/elasticsearch/Version.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ public class Version implements Comparable<Version>, ToXContentFragment {
104104
public static final Version V_6_6_1 = new Version(V_6_6_1_ID, org.apache.lucene.util.Version.LUCENE_7_6_0);
105105
public static final int V_6_6_2_ID = 6060299;
106106
public static final Version V_6_6_2 = new Version(V_6_6_2_ID, org.apache.lucene.util.Version.LUCENE_7_6_0);
107-
public static final int V_6_7_0_ID = 6070099;
108-
public static final Version V_6_7_0 = new Version(V_6_7_0_ID, org.apache.lucene.util.Version.LUCENE_7_7_0);
109-
public static final int V_6_7_1_ID = 6070199;
110-
public static final Version V_6_7_1 = new Version(V_6_7_1_ID, org.apache.lucene.util.Version.LUCENE_7_7_0);
111-
public static final int V_6_7_2_ID = 6070299;
112-
public static final Version V_6_7_2 = new Version(V_6_7_2_ID, org.apache.lucene.util.Version.LUCENE_7_7_0);
113-
public static final int V_6_7_3_ID = 6070399;
114-
public static final Version V_6_7_3 = new Version(V_6_7_3_ID, org.apache.lucene.util.Version.LUCENE_7_7_0);
115107
public static final int V_6_8_0_ID = 6080099;
116108
public static final Version V_6_8_0 = new Version(V_6_8_0_ID, org.apache.lucene.util.Version.LUCENE_7_7_0);
117109
public static final int V_7_0_0_ID = 7000099;
@@ -154,14 +146,6 @@ public static Version fromId(int id) {
154146
return V_7_0_0;
155147
case V_6_8_0_ID:
156148
return V_6_8_0;
157-
case V_6_7_3_ID:
158-
return V_6_7_3;
159-
case V_6_7_1_ID:
160-
return V_6_7_1;
161-
case V_6_7_2_ID:
162-
return V_6_7_2;
163-
case V_6_7_0_ID:
164-
return V_6_7_0;
165149
case V_6_6_2_ID:
166150
return V_6_6_2;
167151
case V_6_6_1_ID:

server/src/main/java/org/elasticsearch/index/engine/ReadOnlyEngine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ protected void ensureMaxSeqNoEqualsToGlobalCheckpoint(final SeqNoStats seqNoStat
131131
// that guarantee that all operations have been flushed to Lucene.
132132
final Version indexVersionCreated = engineConfig.getIndexSettings().getIndexVersionCreated();
133133
if (indexVersionCreated.onOrAfter(Version.V_7_2_0) ||
134-
(seqNoStats.getGlobalCheckpoint() != SequenceNumbers.UNASSIGNED_SEQ_NO && indexVersionCreated.onOrAfter(Version.V_6_7_0))) {
134+
(seqNoStats.getGlobalCheckpoint() != SequenceNumbers.UNASSIGNED_SEQ_NO)) {
135135
if (seqNoStats.getMaxSeqNo() != seqNoStats.getGlobalCheckpoint()) {
136136
throw new IllegalStateException("Maximum sequence number [" + seqNoStats.getMaxSeqNo()
137137
+ "] from last commit does not match global checkpoint [" + seqNoStats.getGlobalCheckpoint() + "]");

server/src/main/java/org/elasticsearch/indices/recovery/RecoverySourceHandler.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.apache.lucene.store.RateLimiter;
3131
import org.apache.lucene.util.ArrayUtil;
3232
import org.elasticsearch.ExceptionsHelper;
33-
import org.elasticsearch.Version;
3433
import org.elasticsearch.action.ActionListener;
3534
import org.elasticsearch.action.StepListener;
3635
import org.elasticsearch.cluster.routing.IndexShardRoutingTable;
@@ -112,8 +111,7 @@ public RecoverySourceHandler(final IndexShard shard, RecoveryTargetHandler recov
112111
this.shardId = this.request.shardId().id();
113112
this.logger = Loggers.getLogger(getClass(), request.shardId(), "recover to " + request.targetNode().getName());
114113
this.chunkSizeInBytes = fileChunkSizeInBytes;
115-
// if the target is on an old version, it won't be able to handle out-of-order file chunks.
116-
this.maxConcurrentFileChunks = request.targetNode().getVersion().onOrAfter(Version.V_6_7_0) ? maxConcurrentFileChunks : 1;
114+
this.maxConcurrentFileChunks = maxConcurrentFileChunks;
117115
}
118116

119117
public StartRecoveryRequest getRequest() {

server/src/test/java/org/elasticsearch/BuildTests.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import java.io.InputStream;
3131
import java.net.URL;
3232
import java.util.Arrays;
33-
import java.util.List;
3433
import java.util.Objects;
3534
import java.util.Set;
3635
import java.util.stream.Collectors;
@@ -194,39 +193,6 @@ public void testSerialization() {
194193
});
195194
}
196195

197-
public void testSerializationBWC() throws IOException {
198-
final WriteableBuild dockerBuild = new WriteableBuild(new Build(randomFrom(Build.Flavor.values()), Build.Type.DOCKER,
199-
randomAlphaOfLength(6), randomAlphaOfLength(6), randomBoolean(), randomAlphaOfLength(6)));
200-
201-
final List<Version> versions = Version.getDeclaredVersions(Version.class);
202-
final Version pre63Version = randomFrom(versions.stream().filter(v -> v.before(Version.V_6_3_0)).collect(Collectors.toList()));
203-
final Version post63Pre67Version = randomFrom(versions.stream()
204-
.filter(v -> v.onOrAfter(Version.V_6_3_0) && v.before(Version.V_6_7_0)).collect(Collectors.toList()));
205-
final Version post67Pre70Version = randomFrom(versions.stream()
206-
.filter(v -> v.onOrAfter(Version.V_6_7_0) && v.before(Version.V_7_0_0)).collect(Collectors.toList()));
207-
final Version post70Version = randomFrom(versions.stream().filter(v -> v.onOrAfter(Version.V_7_0_0)).collect(Collectors.toList()));
208-
209-
final WriteableBuild pre63 = copyWriteable(dockerBuild, writableRegistry(), WriteableBuild::new, pre63Version);
210-
final WriteableBuild post63pre67 = copyWriteable(dockerBuild, writableRegistry(), WriteableBuild::new, post63Pre67Version);
211-
final WriteableBuild post67pre70 = copyWriteable(dockerBuild, writableRegistry(), WriteableBuild::new, post67Pre70Version);
212-
final WriteableBuild post70 = copyWriteable(dockerBuild, writableRegistry(), WriteableBuild::new, post70Version);
213-
214-
assertThat(pre63.build.flavor(), equalTo(Build.Flavor.OSS));
215-
assertThat(post63pre67.build.flavor(), equalTo(dockerBuild.build.flavor()));
216-
assertThat(post67pre70.build.flavor(), equalTo(dockerBuild.build.flavor()));
217-
assertThat(post70.build.flavor(), equalTo(dockerBuild.build.flavor()));
218-
219-
assertThat(pre63.build.type(), equalTo(Build.Type.UNKNOWN));
220-
assertThat(post63pre67.build.type(), equalTo(Build.Type.TAR));
221-
assertThat(post67pre70.build.type(), equalTo(dockerBuild.build.type()));
222-
assertThat(post70.build.type(), equalTo(dockerBuild.build.type()));
223-
224-
assertThat(pre63.build.getQualifiedVersion(), equalTo(pre63Version.toString()));
225-
assertThat(post63pre67.build.getQualifiedVersion(), equalTo(post63Pre67Version.toString()));
226-
assertThat(post67pre70.build.getQualifiedVersion(), equalTo(post67Pre70Version.toString()));
227-
assertThat(post70.build.getQualifiedVersion(), equalTo(dockerBuild.build.getQualifiedVersion()));
228-
}
229-
230196
public void testFlavorParsing() {
231197
for (final Build.Flavor flavor : Build.Flavor.values()) {
232198
// strict or not should not impact parsing at all here

server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ public void testShardLockObtainFailedException() throws IOException {
886886

887887
public void testSnapshotInProgressException() throws IOException {
888888
SnapshotInProgressException orig = new SnapshotInProgressException("boom");
889-
Version version = VersionUtils.randomVersionBetween(random(), Version.V_6_7_0, Version.CURRENT);
889+
Version version = VersionUtils.randomVersionBetween(random(), Version.V_7_0_0, Version.CURRENT);
890890
SnapshotInProgressException ex = serialize(orig, version);
891891
assertEquals(orig.getMessage(), ex.getMessage());
892892
}

server/src/test/java/org/elasticsearch/VersionTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ public static void assertUnknownVersion(Version version) {
346346
public void testIsCompatible() {
347347
assertTrue(isCompatible(Version.CURRENT, Version.CURRENT.minimumCompatibilityVersion()));
348348
assertFalse(isCompatible(Version.V_6_6_0, Version.V_7_0_0));
349-
assertFalse(isCompatible(Version.V_6_7_0, Version.V_7_0_0));
350349
assertTrue(isCompatible(Version.V_6_8_0, Version.V_7_0_0));
351350
assertFalse(isCompatible(Version.fromId(2000099), Version.V_7_0_0));
352351
assertFalse(isCompatible(Version.fromId(2000099), Version.V_6_5_0));

server/src/test/java/org/elasticsearch/cluster/action/shard/ShardStateActionTests.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -519,11 +519,7 @@ public void testStartedShardEntrySerialization() throws Exception {
519519
final StartedShardEntry deserialized = new StartedShardEntry(in);
520520
assertThat(deserialized.shardId, equalTo(shardId));
521521
assertThat(deserialized.allocationId, equalTo(allocationId));
522-
if (version.onOrAfter(Version.V_6_7_0)) {
523-
assertThat(deserialized.primaryTerm, equalTo(primaryTerm));
524-
} else {
525-
assertThat(deserialized.primaryTerm, equalTo(0L));
526-
}
522+
assertThat(deserialized.primaryTerm, equalTo(primaryTerm));
527523
assertThat(deserialized.message, equalTo(message));
528524
}
529525
}

0 commit comments

Comments
 (0)