Skip to content

Commit 4188945

Browse files
committed
Adjust BWC for #40823
Relates #40823
1 parent 3cdb2ac commit 4188945

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ protected void ensureMaxSeqNoEqualsToGlobalCheckpoint(final SeqNoStats seqNoStat
130130
// created after the refactoring of the Close Index API and its TransportVerifyShardBeforeCloseAction
131131
// that guarantee that all operations have been flushed to Lucene.
132132
final Version indexVersionCreated = engineConfig.getIndexSettings().getIndexVersionCreated();
133-
if (indexVersionCreated.onOrAfter(Version.V_8_0_0) ||
133+
if (indexVersionCreated.onOrAfter(Version.V_7_1_0) ||
134134
(seqNoStats.getGlobalCheckpoint() != SequenceNumbers.UNASSIGNED_SEQ_NO && indexVersionCreated.onOrAfter(Version.V_6_7_0))) {
135135
if (seqNoStats.getMaxSeqNo() != seqNoStats.getGlobalCheckpoint()) {
136136
throw new IllegalStateException("Maximum sequence number [" + seqNoStats.getMaxSeqNo()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class RecoveryCleanFilesRequest extends TransportRequest {
5252
shardId = ShardId.readShardId(in);
5353
snapshotFiles = new Store.MetadataSnapshot(in);
5454
totalTranslogOps = in.readVInt();
55-
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
55+
if (in.getVersion().onOrAfter(Version.V_7_1_0)) {
5656
globalCheckpoint = in.readZLong();
5757
} else {
5858
globalCheckpoint = SequenceNumbers.UNASSIGNED_SEQ_NO;
@@ -66,7 +66,7 @@ public void writeTo(StreamOutput out) throws IOException {
6666
shardId.writeTo(out);
6767
snapshotFiles.writeTo(out);
6868
out.writeVInt(totalTranslogOps);
69-
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
69+
if (out.getVersion().onOrAfter(Version.V_7_1_0)) {
7070
out.writeZLong(globalCheckpoint);
7171
}
7272
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public void prepareForTranslogOperations(boolean fileBasedRecovery, int totalTra
289289
state().getTranslog().totalOperations(totalTranslogOps);
290290
indexShard().openEngineAndSkipTranslogRecovery();
291291
assert indexShard.getGlobalCheckpoint() >= indexShard.seqNoStats().getMaxSeqNo() ||
292-
indexShard.indexSettings().getIndexVersionCreated().before(Version.V_8_0_0)
292+
indexShard.indexSettings().getIndexVersionCreated().before(Version.V_7_1_0)
293293
: "global checkpoint is not initialized [" + indexShard.seqNoStats() + "]";
294294
return null;
295295
});
@@ -399,7 +399,7 @@ public void cleanFiles(int totalTranslogOps, long globalCheckpoint, Store.Metada
399399
store.ensureIndexHasHistoryUUID();
400400
}
401401
assert globalCheckpoint >= Long.parseLong(sourceMetaData.getCommitUserData().get(SequenceNumbers.MAX_SEQ_NO))
402-
|| indexShard.indexSettings().getIndexVersionCreated().before(Version.V_8_0_0) :
402+
|| indexShard.indexSettings().getIndexVersionCreated().before(Version.V_7_1_0) :
403403
"invalid global checkpoint[" + globalCheckpoint + "] source_meta_data [" + sourceMetaData.getCommitUserData() + "]";
404404
final String translogUUID = Translog.createEmptyTranslog(
405405
indexShard.shardPath().resolveTranslog(), globalCheckpoint, shardId, indexShard.getPendingPrimaryTerm());

0 commit comments

Comments
 (0)