Skip to content

Commit

Permalink
disk_log_builder: add apply_sliding_window_compact()
Browse files Browse the repository at this point in the history
  • Loading branch information
WillemKauf committed Jan 10, 2025
1 parent 796de14 commit 1071191
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/v/storage/tests/storage_e2e_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4061,7 +4061,7 @@ FIXTURE_TEST(test_skipping_compaction_below_start_offset, log_builder_fixture) {
auto& first_seg = log.segments().front();
BOOST_REQUIRE_EQUAL(first_seg->finished_self_compaction(), false);

b.apply_compaction(cfg.compact, *new_start_offset).get();
b.apply_adjacent_merge_compaction(cfg.compact, *new_start_offset).get();

BOOST_REQUIRE_EQUAL(first_seg->finished_self_compaction(), false);

Expand Down
7 changes: 6 additions & 1 deletion src/v/storage/tests/utils/disk_log_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,16 @@ disk_log_builder::apply_retention(gc_config cfg) {
return get_disk_log_impl().do_gc(cfg);
}

ss::future<> disk_log_builder::apply_compaction(
ss::future<> disk_log_builder::apply_adjacent_merge_compaction(
compaction_config cfg, std::optional<model::offset> new_start_offset) {
return get_disk_log_impl().adjacent_merge_compact(cfg, new_start_offset);
}

ss::future<bool> disk_log_builder::apply_sliding_window_compaction(
compaction_config cfg, std::optional<model::offset> new_start_offset) {
return get_disk_log_impl().sliding_window_compact(cfg, new_start_offset);
}

ss::future<bool>
disk_log_builder::update_start_offset(model::offset start_offset) {
return get_disk_log_impl().update_start_offset(start_offset);
Expand Down
5 changes: 4 additions & 1 deletion src/v/storage/tests/utils/disk_log_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,10 @@ class disk_log_builder {
model::timestamp collection_upper_bound,
std::optional<size_t> max_partition_retention_size);
ss::future<std::optional<model::offset>> apply_retention(gc_config cfg);
ss::future<> apply_compaction(
ss::future<> apply_adjacent_merge_compaction(
compaction_config cfg,
std::optional<model::offset> new_start_offset = std::nullopt);
ss::future<bool> apply_sliding_window_compaction(
compaction_config cfg,
std::optional<model::offset> new_start_offset = std::nullopt);
ss::future<bool> update_start_offset(model::offset start_offset);
Expand Down

0 comments on commit 1071191

Please sign in to comment.