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 c25827feb3 (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 <bhalevy@scylladb.com>
This commit is contained in:
Benny Halevy
2024-03-06 10:21:48 +02:00
parent bfe13daed4
commit dc10d02890

View File

@@ -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 {