What a dump costs as the shard grows - #1350
Merged
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A dump costs the shard, not the change.
flush_shard_indexwrites the index out with no bound on how much of it that is. This measureswhat that means, holding the delta fixed: one write between dumps at every size, so what CHANGED is
identical and only the shard size varies.
Twenty times the objects, eighteen times the time, for the same single write. So the cost tracks
what the shard HOLDS rather than what happened to it, and a store pays more to checkpoint the
larger it gets. It pays it repeatedly, too: the cadence is driven by undumped bytes, so a big shard
does not dump less often to compensate -- it dumps just as often and each one costs more.
The counterpart in the design this follows bounds the work per round instead: it takes a capped
list of dirty slots, dumps that set, advances the dumped-log id, and leaves the rest for the next
round. The cost of one dump is then a function of the round limit rather than of the store.
This adds the measurement, not the fix, alongside the compaction probe that landed just before it.
Between them they say the same thing about two phases of the same cycle: ours are whole-shard where
theirs are bounded-per-round, and both costs grow with the store rather than with the work.
The probe is
#[ignore], so it costs nothing on a normal run and can be asked for by name whensomeone changes this path.