From eb80dd1db5591e1932a078ecce421d33a6729e5b Mon Sep 17 00:00:00 2001 From: "Raphael S. Carvalho" Date: Sun, 13 Feb 2022 15:43:06 -0300 Subject: [PATCH] Revert "sstables/compaction_manager: rewrite_sstables(): resolve maintenance group FIXME" This reverts commit 4c05e5f966d691594a604cf076113efc7f42b1af. Moving cleanup to maintenance group made its operation time up to 10x slower than previous release. It's a blocker to 4.6 release, so let's revert it until we figure this all out. Probably this happens because maintenance group is fixed at a relatively small constant, and cleanup may be incrementally generating backlog for regular compaction, where the former is fighting for resources against the latter. Fixes #10060. Signed-off-by: Raphael S. Carvalho Message-Id: <20220213184306.91585-1-raphaelsc@scylladb.com> (cherry picked from commit a9427f150abd20227f8f967ae7b768480097b608) --- compaction/compaction_manager.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compaction/compaction_manager.cc b/compaction/compaction_manager.cc index a7477421e6..4415ed528c 100644 --- a/compaction/compaction_manager.cc +++ b/compaction/compaction_manager.cc @@ -810,7 +810,8 @@ future<> compaction_manager::rewrite_sstables(replica::table* t, sstables::compa auto sstable_level = sst->get_sstable_level(); auto run_identifier = sst->run_identifier(); auto sstable_set_snapshot = can_purge ? std::make_optional(t.get_sstable_set()) : std::nullopt; - auto descriptor = sstables::compaction_descriptor({ sst }, std::move(sstable_set_snapshot), _maintenance_sg.io, + // FIXME: this compaction should run with maintenance priority. + auto descriptor = sstables::compaction_descriptor({ sst }, std::move(sstable_set_snapshot), service::get_local_compaction_priority(), sstable_level, sstables::compaction_descriptor::default_max_sstable_bytes, run_identifier, options); // Releases reference to cleaned sstable such that respective used disk space can be freed. @@ -852,7 +853,7 @@ future<> compaction_manager::rewrite_sstables(replica::table* t, sstables::compa }; compaction_backlog_tracker user_initiated(std::make_unique(_compaction_controller.backlog_of_shares(200), _available_memory)); - completed = co_await with_scheduling_group(_maintenance_sg.cpu, std::ref(perform_rewrite)); + completed = co_await with_scheduling_group(_compaction_controller.sg(), std::ref(perform_rewrite)); } while (!completed); };