From dc10d02890957a93977cfec184e2fe7983cd1888 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Wed, 6 Mar 2024 10:21:48 +0200 Subject: [PATCH] compaction_group::table_state: get_group_id: become self-sufficient Printing the compaction_group group_id as "i/size" where size is the total number of compaction_groups in the table is convenient but it comes with a price of a circular dependency on the table, as noted by Aleksandra Martyniuk in https://github.com/scylladb/scylladb/pull/17149/commits/c25827feb3ae1af570a43b42c1dd5a7c528c2fb7#r1511341251, which can be triggered when hitting an error when adding the compaction_group::table_state to the table's compaction_manager within the table's constructor. This patch just prints the _group_id member resolving the dependency on the table. Signed-off-by: Benny Halevy --- replica/table.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/replica/table.cc b/replica/table.cc index 6c6f25c92b..aadafd29ea 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -3297,7 +3297,7 @@ public: return _t._compaction_manager.get_backlog_tracker(*this); } const std::string get_group_id() const noexcept override { - return fmt::format("{}/{}", _cg.group_id(), _t._compaction_groups.size()); + return fmt::format("{}", _cg.group_id()); } seastar::condition_variable& get_staging_done_condition() noexcept override {