storage
: fixes for book keeping of dirty
and closed
bytes
#25076
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.
There were a number of bugs in the
disk_log_impl
dirty
andclosed
bytes book-keeping that are fixed by this PR:subtract_dirty_segment_bytes
which did not check if the segment in question was already cleanly compacted. This would leave to over-deduction of dirty bytes.do_compact_adjacent_segments()
, it is possible to merge a cleanly compacted segment with a non-cleanly compacted segment. Later on, when this replacement segment is finally marked cleanly compacted, the sum of bytes (including those that have already been removed when the cleanly compacted segment was marked) will once again be deducted. We must add these back and consider them as "dirty" to avoid this over-deduction.do_compact_adjacent_segments()
, a call toremove_segment_permanently()
for one of the segments being merged would remove its dirty and closed bytes. These bytes are still present in the replacement segment and should not be removed.rewrite_segment_with_offset_map()
, we would again over-deduct dirty bytes for a segment that was already marked as cleanly compacted.Backports Required
Release Notes