-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VSR: Use previous
checkpoint_id
for border prepares
# Background Right now, a replica will not prepare (or even queue) requests whose op would extend beyond their next checkpoint's trigger op. This is problematic for performance (the "checkpoint latency spike"), since the replica enters the new checkpoint with nothing to commit. And the "latency spike" is farther exacerbated by the fact that clients will back off retrying their requests. Originally we didn't start preparing past the checkpoint to guard against overwriting WAL entries before they will definitely not be needed again. But thanks to `vsr_checkpoint_interval`, that reason does not apply. However, prepare headers include a `checkpoint_id` ([motivation here](https://github.com/tigerbeetle/tigerbeetle/blob/30cfbfa2eca94b8cd0b1d2a8ce41c7e7720128f0/src/vsr/message_header.zig#L531-L539)). That checkpoint id isn't available until the checkpoint trigger prepare commits. # Fix The first `constants.pipeline_prepare_queue_max` prepares that follow a checkpoint trigger op will now contain the _previous_ checkpoint's id, since that is available both before and after that checkpoint trigger commits. These are called the "border" prepares – they may be prepared during either checkpoint. (This part if not implemented in this commit, though!)
- Loading branch information
1 parent
942ab03
commit 1671571
Showing
2 changed files
with
45 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters