Skip to content

Commit

Permalink
[Segment Replication] Handle update target cp for relocating primary
Browse files Browse the repository at this point in the history
Signed-off-by: Suraj Singh <surajrider@gmail.com>
  • Loading branch information
dreamer-89 committed Mar 20, 2023
1 parent 5f81930 commit d6cc558
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2725,9 +2725,11 @@ public void updateGlobalCheckpointForShard(final String allocationId, final long
* @param visibleCheckpoint the visible checkpoint
*/
public void updateVisibleCheckpointForShard(final String allocationId, final ReplicationCheckpoint visibleCheckpoint) {
assert assertPrimaryMode();
verifyNotClosed();
replicationTracker.updateVisibleCheckpointForShard(allocationId, visibleCheckpoint);
// Update target replication checkpoint only when in active primary mode
if (shardRouting.primary() && replicationTracker.isPrimaryMode()) {
verifyNotClosed();
replicationTracker.updateVisibleCheckpointForShard(allocationId, visibleCheckpoint);
}
}

/**
Expand Down

0 comments on commit d6cc558

Please sign in to comment.