diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java index 8200f868fa50e..d2d6a8540fc05 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -3442,12 +3442,13 @@ assert getLocalCheckpoint() == primaryContext.getCheckpointStates() + primaryContext + "]"; } else { - assert getLocalCheckpoint() == primaryContext.getCheckpointStates().get(routingEntry().allocationId().getId()).getLocalCheckpoint() - || indexSettings().getTranslogDurability() == Durability.ASYNC : "local checkpoint [" - + getLocalCheckpoint() - + "] does not match checkpoint from primary context [" - + primaryContext - + "]"; + assert getLocalCheckpoint() == primaryContext.getCheckpointStates() + .get(routingEntry().allocationId().getId()) + .getLocalCheckpoint() || indexSettings().getTranslogDurability() == Durability.ASYNC : "local checkpoint [" + + getLocalCheckpoint() + + "] does not match checkpoint from primary context [" + + primaryContext + + "]"; } synchronized (mutex) { replicationTracker.activateWithPrimaryContext(primaryContext); // make changes to primaryMode flag only under mutex