Skip to content

Commit

Permalink
Merge pull request #21620 from vbotbuildovich/backport-pr-21581-v24.1…
Browse files Browse the repository at this point in the history
….x-700

[v24.1.x] [CORE-5632] cluster: Reset cloud storage metric in the `cluster::partition::remove_persistent_state`
  • Loading branch information
piyushredpanda authored Aug 9, 2024
2 parents 976f936 + 8a5281e commit e6d6da2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/v/cloud_storage/read_path_probes.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class partition_probe {
uint64_t get_records_read() const noexcept { return _records_read; }
uint64_t get_chunk_size() const noexcept { return _chunk_size; }

void clear_metrics() { _metrics.clear(); }

private:
// Number of bytes that partition reader have received
uint64_t _bytes_read = 0;
Expand Down
1 change: 1 addition & 0 deletions src/v/cluster/partition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ partition::get_cloud_term_last_offset(model::term_id term) const {
}

ss::future<> partition::remove_persistent_state() {
_cloud_storage_probe->clear_metrics();
co_await _raft->stm_manager()->remove_local_state();
}

Expand Down

0 comments on commit e6d6da2

Please sign in to comment.