diff options
author | Jason Tedor <jason@tedor.me> | 2017-06-30 10:59:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-30 10:59:03 -0400 |
commit | dd93ef3f24e91ebf8b8610beea0350ae04b53ced (patch) | |
tree | f07196bd34ec3bbb10d18a7a5752d138d50af3e2 /core/src/main/java | |
parent | c8da7f84a20b836671048749245dba3f2c95dbeb (diff) |
Add additional test for sequence-number recovery
This commit adds a test for a scenario where a replica receives an extra
document that the promoted replica does not receive, misses the
primary/replica re-sync, and the recovers from the newly-promoted
primary.
Relates #25493
Diffstat (limited to 'core/src/main/java')
-rw-r--r-- | core/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java b/core/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java index 429be167e7..dcb6f5759d 100644 --- a/core/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java +++ b/core/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java @@ -356,6 +356,7 @@ public class PeerRecoveryTargetService extends AbstractComponent implements Inde final long globalCheckpoint = Translog.readGlobalCheckpoint(recoveryTarget.translogLocation()); final SeqNoStats seqNoStats = recoveryTarget.store().loadSeqNoStats(globalCheckpoint); if (seqNoStats.getMaxSeqNo() <= seqNoStats.getGlobalCheckpoint()) { + assert seqNoStats.getLocalCheckpoint() <= seqNoStats.getGlobalCheckpoint(); /* * Commit point is good for sequence-number based recovery as the maximum sequence number included in it is below the global * checkpoint (i.e., it excludes any operations that may not be on the primary). Recovery will start at the first operation |