Skip to content

Commit

Permalink
Merge pull request #5939 from NyaliaLui/readers-probe-clear
Browse files Browse the repository at this point in the history
storage: add metrics clear to reader cache probe
  • Loading branch information
NyaliaLui committed Aug 11, 2022
2 parents 7b465d0 + 9bd1c45 commit a38aa4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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

0 comments on commit a38aa4f

Please sign in to comment.