diff --git a/server/src/main/java/org/elasticsearch/index/seqno/ReplicationTracker.java b/server/src/main/java/org/elasticsearch/index/seqno/ReplicationTracker.java index 256fe571a24e5..a3a02de44ef31 100644 --- a/server/src/main/java/org/elasticsearch/index/seqno/ReplicationTracker.java +++ b/server/src/main/java/org/elasticsearch/index/seqno/ReplicationTracker.java @@ -508,10 +508,9 @@ public synchronized void renewPeerRecoveryRetentionLeases() { PEER_RECOVERY_RETENTION_LEASE_SOURCE); } else { // the retention lease is tied to the node, not the shard copy, so it's possible a copy was removed and now - // we are in the process of recovering it again. The recovery process will fix the lease before initiating - // tracking on this copy: - assert checkpointState.tracked == false - && checkpointState.globalCheckpoint == SequenceNumbers.UNASSIGNED_SEQ_NO : + // we are in the process of recovering it again, or maybe we were just promoted and have not yet received the + // global checkpoints from our peers. + assert checkpointState.globalCheckpoint == SequenceNumbers.UNASSIGNED_SEQ_NO : "cannot renew " + retentionLease + " according to " + checkpointState + " for " + shardRouting; } }