Skip to content

Commit 12d94e4

Browse files
committed
Adjust bwc version for max_seq_no_of_updates
Relates #33967 Relates #33842
1 parent ae8e544 commit 12d94e4

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

server/src/main/java/org/elasticsearch/action/support/replication/TransportReplicationAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ public void readFrom(StreamInput in) throws IOException {
12951295
} else {
12961296
globalCheckpoint = SequenceNumbers.UNASSIGNED_SEQ_NO;
12971297
}
1298-
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
1298+
if (in.getVersion().onOrAfter(Version.V_6_5_0)) {
12991299
maxSeqNoOfUpdatesOrDeletes = in.readZLong();
13001300
} else {
13011301
// UNASSIGNED_SEQ_NO (-2) means uninitialized, and replicas will disable
@@ -1310,7 +1310,7 @@ public void writeTo(StreamOutput out) throws IOException {
13101310
if (out.getVersion().onOrAfter(Version.V_6_0_0_alpha1)) {
13111311
out.writeZLong(globalCheckpoint);
13121312
}
1313-
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
1313+
if (out.getVersion().onOrAfter(Version.V_6_5_0)) {
13141314
out.writeZLong(maxSeqNoOfUpdatesOrDeletes);
13151315
}
13161316
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2561,7 +2561,7 @@ private boolean assertMaxSeqNoOfUpdatesIsAdvanced(Term id, long seqNo, boolean a
25612561
final long maxSeqNoOfUpdates = getMaxSeqNoOfUpdatesOrDeletes();
25622562
// If the primary is on an old version which does not replicate msu, we need to relax this assertion for that.
25632563
if (maxSeqNoOfUpdates == SequenceNumbers.UNASSIGNED_SEQ_NO) {
2564-
assert config().getIndexSettings().getIndexVersionCreated().before(Version.V_7_0_0_alpha1);
2564+
assert config().getIndexSettings().getIndexVersionCreated().before(Version.V_6_5_0);
25652565
return true;
25662566
}
25672567
// We treat a delete on the tombstones on replicas as a regular document, then use updateDocument (not addDocument).

server/src/main/java/org/elasticsearch/index/shard/IndexShard.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ public void updateShardState(final ShardRouting newRouting,
504504
if (getMaxSeqNoOfUpdatesOrDeletes() == SequenceNumbers.UNASSIGNED_SEQ_NO) {
505505
// If the old primary was on an old version that did not replicate the msu,
506506
// we need to bootstrap it manually from its local history.
507-
assert indexSettings.getIndexVersionCreated().before(Version.V_7_0_0_alpha1);
507+
assert indexSettings.getIndexVersionCreated().before(Version.V_6_5_0);
508508
engine.advanceMaxSeqNoOfUpdatesOrDeletes(seqNoStats().getMaxSeqNo());
509509
}
510510
engine.restoreLocalHistoryFromTranslog((resettingEngine, snapshot) ->
@@ -1957,7 +1957,7 @@ public void activateWithPrimaryContext(final ReplicationTracker.PrimaryContext p
19571957
if (getMaxSeqNoOfUpdatesOrDeletes() == SequenceNumbers.UNASSIGNED_SEQ_NO) {
19581958
// If the old primary was on an old version that did not replicate the msu,
19591959
// we need to bootstrap it manually from its local history.
1960-
assert indexSettings.getIndexVersionCreated().before(Version.V_7_0_0_alpha1);
1960+
assert indexSettings.getIndexVersionCreated().before(Version.V_6_5_0);
19611961
getEngine().advanceMaxSeqNoOfUpdatesOrDeletes(seqNoStats().getMaxSeqNo());
19621962
}
19631963
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public void readFrom(StreamInput in) throws IOException {
8989
} else {
9090
maxSeenAutoIdTimestampOnPrimary = IndexRequest.UNSET_AUTO_GENERATED_TIMESTAMP;
9191
}
92-
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
92+
if (in.getVersion().onOrAfter(Version.V_6_5_0)) {
9393
maxSeqNoOfUpdatesOrDeletesOnPrimary = in.readZLong();
9494
} else {
9595
// UNASSIGNED_SEQ_NO means uninitialized and replica won't enable optimization using seq_no
@@ -107,7 +107,7 @@ public void writeTo(StreamOutput out) throws IOException {
107107
if (out.getVersion().onOrAfter(Version.V_6_5_0)) {
108108
out.writeZLong(maxSeenAutoIdTimestampOnPrimary);
109109
}
110-
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
110+
if (out.getVersion().onOrAfter(Version.V_6_5_0)) {
111111
out.writeZLong(maxSeqNoOfUpdatesOrDeletesOnPrimary);
112112
}
113113
}

0 commit comments

Comments
 (0)