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

storage: add metrics clear to reader cache probe #5939

Merged
merged 1 commit into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/v/storage/readers_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ ss::future<> readers_cache::stop() {
_readers.clear_and_dispose([](entry* e) {
delete e; // NOLINT
});
/**
* Stop and clear metrics as well or risk a double registrion on partition
* movements. For details see
* https://github.com/redpanda-data/redpanda/issues/5938
*/
_probe.clear();
}

ss::future<readers_cache::range_lock_holder>
Expand Down
1 change: 1 addition & 0 deletions src/v/storage/readers_cache_probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class readers_cache_probe {
void reader_evicted() { _readers_evicted++; }
void cache_hit() { _cache_hits++; }
void cache_miss() { _cache_misses++; }
void clear() { _metrics.clear(); }

void setup_metrics(const model::ntp& ntp);

Expand Down