mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-05 14:33:08 +00:00
The storage_service::track_upgrade_progress_to_topology_coordinator function is supposed to wait on the SUPPORTS_CONSISTENT_TOPOLOGY_CHANGES cluster feature (among other things) before starting the raft_state_monitor_fiber. The wait is realized by passing a callback to feature::when_enabled which sets a shared_promise that is waited on by the tracking fiber. If the feature is already enabled, when_enabled will call the callback immediately. However, if it's not, then it will return a non-null listener_registration object - as long as it is alive, the callback is registered. The listener_registration object was not assigned to a variable which caused it to be destroyed shortly after the when_enabled function returns. Due to that, if upgrade was requested but the current group0 leader didn't have the SUPPORTS_CONSISTENT_TOPOLOGY_CHANGES feature enabled right after boot, the upgrade would not start until the leader is changed to a node which has that cluster feature already enabled on boot. Moreover, the topology coordinator would not start on such a node until the node were rebooted. Fix the issue by assigning the subscription to a variable.