diff --git a/compaction/compaction_manager.cc b/compaction/compaction_manager.cc index 61e38c8e0f..6f3916ad18 100644 --- a/compaction/compaction_manager.cc +++ b/compaction/compaction_manager.cc @@ -526,12 +526,12 @@ future compaction_manager::perform_com co_return co_await perform_task(std::move(task_executor)); } -future<> compaction_manager::perform_major_compaction(table_state& t, tasks::task_info info) { +future<> compaction_manager::perform_major_compaction(table_state& t, std::optional info) { if (_state != state::enabled) { co_return; } - co_await perform_compaction(info ? std::make_optional(info) : std::nullopt, &t, info.id).discard_result(); + co_await perform_compaction(info, &t, info.value_or(tasks::task_info{}).id).discard_result(); } namespace compaction { diff --git a/compaction/compaction_manager.hh b/compaction/compaction_manager.hh index c5a50d1ead..cfbd4b5c65 100644 --- a/compaction/compaction_manager.hh +++ b/compaction/compaction_manager.hh @@ -323,7 +323,7 @@ public: future perform_sstable_scrub(compaction::table_state& t, sstables::compaction_type_options::scrub opts); // Submit a table for major compaction. - future<> perform_major_compaction(compaction::table_state& t, tasks::task_info info = {}); + future<> perform_major_compaction(compaction::table_state& t, std::optional info = std::nullopt); // Run a custom job for a given table, defined by a function diff --git a/replica/database.hh b/replica/database.hh index 9c43f68347..97e3f5bb52 100644 --- a/replica/database.hh +++ b/replica/database.hh @@ -857,7 +857,7 @@ public: // Start a compaction of all sstables in a process known as major compaction // Active memtable is flushed first to guarantee that data like tombstone, // sitting in the memtable, will be compacted with shadowed data. - future<> compact_all_sstables(tasks::task_info info = {}); + future<> compact_all_sstables(std::optional info = std::nullopt); future snapshot_exists(sstring name); diff --git a/replica/table.cc b/replica/table.cc index 463dddf5a0..f1cc6b47bb 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -1225,7 +1225,7 @@ compaction_group::update_main_sstable_list_on_compaction_completion(sstables::co } future<> -table::compact_all_sstables(tasks::task_info info) { +table::compact_all_sstables(std::optional info) { co_await flush(); co_await parallel_foreach_compaction_group([this, info] (compaction_group& cg) { return _compaction_manager.perform_major_compaction(cg.as_table_state(), info);