Skip to content

Commit

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

[v24.1.x] cloud storage: Fix deleted_count in clean_up_at_start
  • Loading branch information
BenPope committed Aug 5, 2024
2 parents f54d568 + 432bc06 commit cfe8eee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/v/cloud_storage/cache_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ ss::future<> cache::clean_up_at_start() {
try {
co_await delete_file_and_empty_parents(filepath_to_remove);
deleted_bytes += file_item.size;
deleted_bytes++;
deleted_count++;
} catch (std::exception& e) {
vlog(
cst_log.error,
Expand Down
1 change: 1 addition & 0 deletions src/v/cloud_storage/tests/cache_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ FIXTURE_TEST(test_clean_up_on_start, cache_test_fixture) {
BOOST_CHECK(!ss::file_exists((CACHE_DIR / tmp_key).native()).get());
BOOST_CHECK(!ss::file_exists(empty_dir_path.native()).get());
BOOST_CHECK(ss::file_exists(populated_dir_path.native()).get());
BOOST_CHECK_EQUAL(get_object_count(), 2);
}

/**
Expand Down

0 comments on commit cfe8eee

Please sign in to comment.