Skip to content

Commit

Permalink
Merge pull request redpanda-data#18138 from Lazin/backport-pr-18056-v…
Browse files Browse the repository at this point in the history
…23.3.x-62

[v23.3.x] cloud_storage: Implement "carryover" cache trimming mechanism
  • Loading branch information
piyushredpanda authored Apr 29, 2024
2 parents 67b8f15 + bc434c6 commit 36f688c
Show file tree
Hide file tree
Showing 12 changed files with 510 additions and 101 deletions.
5 changes: 5 additions & 0 deletions src/v/cloud_storage/cache_probe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ cache_probe::cache_probe() {
"Number of times we couldn't free enough space with a fast "
"trim and had to fall back to a slower exhaustive trim."))
.aggregate(aggregate_labels),
sm::make_counter(
"carryover_trims",
[this] { return _carryover_trims; },
sm::description("Number of times we invoked carryover trim."))
.aggregate(aggregate_labels),
sm::make_counter(
"failed_trims",
[this] { return _failed_trims; },
Expand Down
2 changes: 2 additions & 0 deletions src/v/cloud_storage/cache_probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class cache_probe {

void fast_trim() { ++_fast_trims; }
void exhaustive_trim() { ++_exhaustive_trims; }
void carryover_trim() { ++_carryover_trims; }
void failed_trim() { ++_failed_trims; }

private:
Expand All @@ -55,6 +56,7 @@ class cache_probe {

int64_t _fast_trims{0};
int64_t _exhaustive_trims{0};
int64_t _carryover_trims{0};
int64_t _failed_trims{0};

metrics::internal_metric_groups _metrics;
Expand Down
Loading

0 comments on commit 36f688c

Please sign in to comment.