Skip to content

Commit

Permalink
Add assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
jasontedor committed Jul 4, 2017
1 parent 813032a commit 385c948
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Expand Up @@ -127,6 +127,7 @@ public synchronized void markSeqNoAsCompleted(final long seqNo) {
* @param checkpoint the local checkpoint to reset this tracker to
*/
synchronized void resetCheckpoint(final long checkpoint) {
assert checkpoint != SequenceNumbersService.UNASSIGNED_SEQ_NO;
assert checkpoint <= this.checkpoint;
processedSeqNo.clear();
firstProcessedSeqNo = checkpoint + 1;
Expand Down
Expand Up @@ -2057,6 +2057,7 @@ public void acquireReplicaOperationPermit(final long operationPrimaryTerm, final
assert operationPrimaryTerm > primaryTerm :
"shard term already update. op term [" + operationPrimaryTerm + "], shardTerm [" + primaryTerm + "]";
primaryTerm = operationPrimaryTerm;
assert globalCheckpoint != SequenceNumbersService.UNASSIGNED_SEQ_NO;
updateGlobalCheckpointOnReplica(globalCheckpoint);
logger.trace(
"detected new primary with primary term [{}], resetting local checkpoint from [{}] to [{}]",
Expand Down

0 comments on commit 385c948

Please sign in to comment.