Skip to content

Commit

Permalink
Update global checkpoint with permit after recovery
Browse files Browse the repository at this point in the history
After recovery completes from a primary, we now update the local
knowledge on the primary of the global checkpoint on the recovery
target. However if this occurs concurrently with a relocation, an
assertion could trip that we are no longer in primary mode. As this
local knowledge should only be tracked when we are in primary mode,
updating this local knowledge should be done under a permit. This commit
causes that to be the case.

Relates #26666
  • Loading branch information
jasontedor committed Sep 18, 2017
1 parent 6f25163 commit 23093ad
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ public void finalizeRecovery(final long targetLocalCheckpoint) {
runUnderPrimaryPermit(() -> shard.markAllocationIdAsInSync(request.targetAllocationId(), targetLocalCheckpoint));
final long globalCheckpoint = shard.getGlobalCheckpoint();
cancellableThreads.execute(() -> recoveryTarget.finalizeRecovery(globalCheckpoint));
shard.updateGlobalCheckpointForShard(request.targetAllocationId(), globalCheckpoint);
runUnderPrimaryPermit(() -> shard.updateGlobalCheckpointForShard(request.targetAllocationId(), globalCheckpoint));

if (request.isPrimaryRelocation()) {
logger.trace("performing relocation hand-off");
Expand Down

0 comments on commit 23093ad

Please sign in to comment.