-
Notifications
You must be signed in to change notification settings - Fork 552
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
CORE-2024: local storage probe for compacted away bytes vectorized_storage_log_compaction_removed_bytes
#17579
CORE-2024: local storage probe for compacted away bytes vectorized_storage_log_compaction_removed_bytes
#17579
Conversation
/ci-repeat 1 |
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/47313#018ea4e9-812a-490f-a23f-403f3a9012d0 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/47313#018ea4e9-812e-4f96-9987-0912550c291a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to add a test. You mentioned offline you have a ducktape one coming up, but I'd suggest considering writing a fixture test, since it'll give you more control over what when uploads happen
src/v/storage/segment_utils.cc
Outdated
pb.segment_compacted(); | ||
pb.add_compacted_away_bytes(sz_before - *sz_after); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to do this for windowed compaction as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's guaranteed that sz_before >= *sz_after
, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Lazin good point. I had a bit of dive, and I don't see a guarantee in the code or a fuzz test for this (I might be wrong; pls correct me). It seems difficult that the implementation would produce a bigger file, but bugs are not always obvious.
I moved the metric to ssize_t
, I wonder if I should also add a warn (or even error) message for this condition
Also I know these are kind of related, but they seem like pretty independent ideas that don't depend to each other. Especially if you plan on adding tests for them and this PR grows, I think it's worth splitting into a couple PRs. |
3e6f7a9
to
0b22295
Compare
vectorized_storage_log_compacted_away_bytes
force push: removed commit not relevant to separate pr here #17627 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good! Just a naming suggestion.
You mentioned adding a probe test -- is that for this PR?
i'd like to say for both PR. I'll commit it separately on both, and later I'm thinking of a followup to move the find_metric helper under test/utils |
src/v/storage/segment_utils.cc
Outdated
pb.segment_compacted(); | ||
pb.add_compacted_away_bytes(sz_before - *sz_after); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's guaranteed that sz_before >= *sz_after
, correct?
vectorized_storage_log_compacted_away_bytes
vectorized_storage_log_compacted_away_bytes
new ntp metric to keep track of how many bytes are removed by compaction
probe is updated in self_compact_segment and sliding_window_compact
check that vectorized_storage_log_compaction_removed_bytes_total has the expected behaviour in various compaction configurations it should not increase for "delete", should increase for "compact" or "compact,delete"
0b22295
to
f2a1a54
Compare
vectorized_storage_log_compacted_away_bytes
vectorized_storage_log_compaction_removed_bytes
review feedbacks and ducktape test to check that the metric increases |
failure is #14425 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
ntp metrics for compaction observability:
vectorized_storage_log_compaction_removed_bytes
a counter metric that hooks in
self_compact_segments()
and sliding_window_compact()
to recordsize_before - size_after
at each successful invocation.Fixes https://github.com/redpanda-data/core-internal/issues/1232
Backports Required
Release Notes
Features