Skip to content

Commit

Permalink
cst/config: Disable trim carryover
Browse files Browse the repository at this point in the history
The trim carryover feature remembers items to be trimmed to quickly free
up space on trim without going to disk.

With access tracker based trim, carryover can remove files, the updates
to the inner data structure of access tracker can be pending and the
tracker can try to delete these files again. This can potentially result
in error logs due to double-delete of files.

The carryover limit is set to 0 so that the list does not carry any
items. A user can still set the list to some value and enable the
feature, but this can result in error logs.

(cherry picked from commit 71210aa)
  • Loading branch information
abhijat authored and vbotbuildovich committed Jul 22, 2024
1 parent 4a5509a commit 4c56da6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/v/cloud_storage/tests/cache_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <boost/test/unit_test.hpp>

#include <chrono>
#include <cstdint>
#include <fstream>
#include <optional>
#include <stdexcept>
Expand Down Expand Up @@ -565,6 +566,10 @@ FIXTURE_TEST(test_log_segment_cleanup, cache_test_fixture) {
}

FIXTURE_TEST(test_cache_carryover_trim, cache_test_fixture) {
scoped_config cfg;
cfg.get("cloud_storage_cache_trim_carryover_bytes")
.set_value(uint32_t{256_KiB});

std::string write_buf(1_MiB, ' ');
random_generators::fill_buffer_randomchars(
write_buf.data(), write_buf.size());
Expand Down
7 changes: 4 additions & 3 deletions src/v/config/configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2436,10 +2436,11 @@ configuration::configuration()
"over to the next trim operation. This parameter sets a limit on the "
"memory occupied by objects that can be carried over from one trim to "
"next, and allows cache to quickly unblock readers before starting the "
"directory inspection.",
{.needs_restart = needs_restart::no, .visibility = visibility::tunable},
"directory inspection (deprecated)",
{.needs_restart = needs_restart::no,
.visibility = visibility::deprecated},
// This roughly translates to around 1000 carryover file names
256_KiB)
0_KiB)
, cloud_storage_cache_check_interval_ms(
*this,
"cloud_storage_cache_check_interval",
Expand Down

0 comments on commit 4c56da6

Please sign in to comment.