storage
: book keep dirty_ratio
in disk_log_impl
#24649
Open
+215
−12
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.
TODO: Consider eviction, ducktape testing
The dirty ratio of a log is defined as the ratio between the number of bytes in "dirty" segments and the total number of bytes in closed segments.
Dirty segments are closed segments which have not yet been cleanly compacted- i.e, duplicates for keys in this segment could be found in the prefix of the log up to this segment.
Add book-keeping to
disk_log_impl
in order to cache both_dirty_segment_bytes
as well as_closed_segment_bytes
, which allows us to calculate the dirty ratio, and add observability for it instorage::probe
.In the future, this could be used in combination with a compaction configuration a la min.cleanable.dirty.ratio to schedule compaction.
Backports Required
Release Notes
Improvements
dirty_segment_bytes
andclosed_segment_bytes
to the storage layer.