diff --git a/api/storage_service.cc b/api/storage_service.cc index 2e9295c224..269c9cad9c 100644 --- a/api/storage_service.cc +++ b/api/storage_service.cc @@ -660,7 +660,7 @@ void set_storage_service(http_context& ctx, routes& r, sharded that is resolved when offstrategy_compaction completes. // The future value is true iff offstrategy compaction was required. future perform_offstrategy_compaction(); + future<> perform_cleanup_compaction(owned_ranges_ptr sorted_owned_ranges); + void set_compaction_strategy(sstables::compaction_strategy_type strategy); const sstables::compaction_strategy& get_compaction_strategy() const { return _compaction_strategy; @@ -909,7 +911,11 @@ public: return _compaction_strategy; } - const compaction_manager& get_compaction_manager() const { + const compaction_manager& get_compaction_manager() const noexcept { + return _compaction_manager; + } + + compaction_manager& get_compaction_manager() noexcept { return _compaction_manager; } diff --git a/replica/table.cc b/replica/table.cc index e790bf1dfc..93c4d38330 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -1149,6 +1149,10 @@ future table::perform_offstrategy_compaction() { return _compaction_manager.perform_offstrategy(as_table_state()); } +future<> table::perform_cleanup_compaction(compaction::owned_ranges_ptr sorted_owned_ranges) { + co_await get_compaction_manager().perform_cleanup(std::move(sorted_owned_ranges), as_table_state()); +} + void table::set_compaction_strategy(sstables::compaction_strategy_type strategy) { tlogger.debug("Setting compaction strategy of {}.{} to {}", _schema->ks_name(), _schema->cf_name(), sstables::compaction_strategy::name(strategy)); auto new_cs = make_compaction_strategy(strategy, _schema->compaction_strategy_options());