raft: separate group0 server start from in-memory state machine enablement

Split start_server_for_group0 so it only starts the raft server and
replays the log (applying mutations to system tables), without loading
the state into memory. A new enable_group0_state_machine() method is
added which callers must invoke explicitly after all dependencies
(CDC generation service, non-system schemas, etc.) are available.

This prepares for moving setup_group0_if_exist earlier in the startup
sequence so the raft log can be replayed before non-system keyspaces
are loaded, while deferring the in-memory state loading until after
all dependencies are initialized.
This commit is contained in:
Gleb Natapov
2026-06-01 14:05:41 +03:00
parent 3613d9a07d
commit 492a75ffbb
4 changed files with 23 additions and 4 deletions

View File

@@ -1127,6 +1127,7 @@ private:
if (!group0_service.maintenance_mode() && _sys_ks.local().bootstrap_complete()) {
group0_service.setup_group0_if_exist(_sys_ks.local(), _ss.local(), _qp.local(), _mm.local()).get();
group0_service.enable_group0_state_machine().get();
}
_groups_manager.invoke_on_all([](service::strong_consistency::groups_manager& m) {
return m.start();