mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-02 04:56:58 +00:00
It's a bit hairy. The maybe_enable_features() is called from two places -- the feature_enabler upon notifications from gossiper and directory by gossiper from wait_for_gossip_to_settle(). The _latter_ is called only when the wait_for_gossip_to_settle() is called for the first time because of the _gossip_settled checks in it. For the first time this method is called by storage_service when it tries to join the ring (next it's called from main, but that's not of interest here). Next, despite feature_enabler is registered early -- when gossiper instance is constructed by sharded<gossiper>::start() -- it checks for the _gossip_settled to be true to take any actions. Considering both -- calling maybe_enable_features() _and_ registering enabler after storage_service's call to wait_for_gossip_to_settle() doesn't break the code logic, but make further patching possible. In particular, the feature_enabler will move to feature_service not to pollute gossiper code with anything that's not gossiping. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>