Skip to content

Commit

Permalink
Keep the old assertion same for non remote backed indexes
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <[email protected]>
  • Loading branch information
Sachin Kale committed Dec 14, 2023
1 parent 303eff0 commit 833c1b6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions server/src/main/java/org/opensearch/index/shard/IndexShard.java
Original file line number Diff line number Diff line change
Expand Up @@ -3433,12 +3433,6 @@ public void activateWithPrimaryContext(final ReplicationTracker.PrimaryContext p
+ "] does not contain relocation target ["
+ routingEntry()
+ "]";
assert getLocalCheckpoint() >= primaryContext.getCheckpointStates().get(routingEntry().allocationId().getId()).getLocalCheckpoint()
|| indexSettings().getTranslogDurability() == Durability.ASYNC : "local checkpoint ["
+ getLocalCheckpoint()
+ "] does not match checkpoint from primary context ["
+ primaryContext
+ "]";
if (isRemoteStoreEnabled()) {
assert getLocalCheckpoint() == primaryContext.getCheckpointStates()
.get(primaryContext.getRoutingTable().primaryShard().allocationId().getId())
Expand All @@ -3447,6 +3441,13 @@ assert getLocalCheckpoint() == primaryContext.getCheckpointStates()
+ "] does not match checkpoint from local checkpoint of old primary for remote store backed index ["
+ 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
+ "]";
}
synchronized (mutex) {
replicationTracker.activateWithPrimaryContext(primaryContext); // make changes to primaryMode flag only under mutex
Expand Down

0 comments on commit 833c1b6

Please sign in to comment.