diff --git a/replica/database.hh b/replica/database.hh index 050500b6de..9aecc9052b 100644 --- a/replica/database.hh +++ b/replica/database.hh @@ -996,7 +996,9 @@ public: // a future that is resolved when offstrategy_compaction completes. // The future value is true iff offstrategy compaction was required. future perform_offstrategy_compaction(std::optional info = std::nullopt); - future<> perform_cleanup_compaction(owned_ranges_ptr sorted_owned_ranges, std::optional info = std::nullopt); + future<> perform_cleanup_compaction(owned_ranges_ptr sorted_owned_ranges, + std::optional info = std::nullopt, + do_flush = do_flush::yes); unsigned estimate_pending_compactions() const; void set_compaction_strategy(sstables::compaction_strategy_type strategy); diff --git a/replica/table.cc b/replica/table.cc index 97e20204e6..f182b0508e 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -1626,9 +1626,12 @@ future table::perform_offstrategy_compaction(std::optional table::perform_cleanup_compaction(compaction::owned_ranges_ptr sorted_owned_ranges, std::optional info) { - co_await flush(); - +future<> table::perform_cleanup_compaction(compaction::owned_ranges_ptr sorted_owned_ranges, + std::optional info, + do_flush do_flush) { + if (do_flush) { + co_await flush(); + } if (_compaction_groups.size() == 1) { auto& cg = *get_compaction_group(0); co_return co_await get_compaction_manager().perform_cleanup(std::move(sorted_owned_ranges), cg.as_table_state(), info);