Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Document prepare.checkpoint_id and constants.checkpoint_interval #1457

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

sentientwaffle
Copy link
Member

No description provided.

@sentientwaffle sentientwaffle marked this pull request as ready for review January 23, 2024 18:14
Comment on lines 45 to 49
/// The checkpoint interval must be less than the WAL length by the sum of:
/// - `lsm_batch_multiple`: Ensure that the final batch of entries immediately preceding a
/// checkpoint trigger is not overwritten by the following checkpoint's entries. This final
/// batch's updates were not persisted as part of the former checkpoint – they are only in memory
/// until they are compacted by the *next* batch of commits (i.e. the first batch of the following
/// checkpoint).
/// - `pipeline_prepare_queue_max` (rounded up to the nearest batch multiple): This margin ensures
/// that the entries prepared immediately following a checkpoint trigger never overwrite an entry
/// from the previous WAL wrap until a quorum of replicas has reached that checkpoint.
pub const vsr_checkpoint_interval = journal_slot_count -
lsm_batch_multiple -
lsm_batch_multiple * stdx.div_ceil(pipeline_prepare_queue_max, lsm_batch_multiple);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's maybe move the two points down to assert bellow, and here instead say that we pick the largest checkpoint interval that satisfies the assert.

Basically, while the assert below and the initialization here looks redundant, they are not: we can pick any value between lsm_batch_multiple and the upper bound, it's just that picking exactly the upper bound is most optimal for performance.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent point!

@sentientwaffle sentientwaffle force-pushed the dj-docs-checkpoint-interval-and-id branch from 2d951c8 to dc024ce Compare January 23, 2024 18:23
@sentientwaffle sentientwaffle added this pull request to the merge queue Jan 24, 2024
Merged via the queue into main with commit 8e63afc Jan 24, 2024
25 checks passed
@sentientwaffle sentientwaffle deleted the dj-docs-checkpoint-interval-and-id branch January 24, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants