mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-01 04:26:48 +00:00
replica: table: pass do_flush to table::perform_cleanup_compaction()
this parameter defaults to do_flush::yes, so the existing behavior is preserved. and this change prepares for a change which flushes all tables before performing cleanup on the tables per-demand. please note, we cannot pass compaction::flush_mode to this function, as it is used by compaction/task_manager_module.hh, if we want to share it by both database.hh and compaction/task_manager_module.hh, we would have to find it a new home. so `table::do_flush` boolean tag is reused instead. Refs #16757 Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
This commit is contained in:
@@ -996,7 +996,9 @@ public:
|
||||
// a future<bool> that is resolved when offstrategy_compaction completes.
|
||||
// The future value is true iff offstrategy compaction was required.
|
||||
future<bool> perform_offstrategy_compaction(std::optional<tasks::task_info> info = std::nullopt);
|
||||
future<> perform_cleanup_compaction(owned_ranges_ptr sorted_owned_ranges, std::optional<tasks::task_info> info = std::nullopt);
|
||||
future<> perform_cleanup_compaction(owned_ranges_ptr sorted_owned_ranges,
|
||||
std::optional<tasks::task_info> info = std::nullopt,
|
||||
do_flush = do_flush::yes);
|
||||
unsigned estimate_pending_compactions() const;
|
||||
|
||||
void set_compaction_strategy(sstables::compaction_strategy_type strategy);
|
||||
|
||||
@@ -1626,9 +1626,12 @@ future<bool> table::perform_offstrategy_compaction(std::optional<tasks::task_inf
|
||||
co_return performed;
|
||||
}
|
||||
|
||||
future<> table::perform_cleanup_compaction(compaction::owned_ranges_ptr sorted_owned_ranges, std::optional<tasks::task_info> info) {
|
||||
co_await flush();
|
||||
|
||||
future<> table::perform_cleanup_compaction(compaction::owned_ranges_ptr sorted_owned_ranges,
|
||||
std::optional<tasks::task_info> 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);
|
||||
|
||||
Reference in New Issue
Block a user