diff --git a/service/storage_service.cc b/service/storage_service.cc index 21357c43c0..534ee77c2d 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -1834,9 +1834,6 @@ future<> storage_service::join_topology(sharded } } - // If we were the first node in the cluster, at this point `upgrade_state` will be - // initialized properly. Yield control to group 0 - _manage_topology_change_kind_from_group0 = true; set_topology_change_kind(upgrade_state_to_topology_op_kind(_topology_state_machine._topology.upgrade_state)); co_await update_topology_with_local_metadata(*raft_server); @@ -1870,7 +1867,6 @@ future<> storage_service::join_topology(sharded co_return; } - _manage_topology_change_kind_from_group0 = true; set_topology_change_kind(upgrade_state_to_topology_op_kind(_topology_state_machine._topology.upgrade_state)); // We bootstrap if we haven't successfully bootstrapped before, as long as we are not a seed. @@ -2948,8 +2944,7 @@ future<> storage_service::join_cluster(sharded& slogger.info("Raft recovery - starting in legacy topology operations mode"); set_topology_change_kind(topology_change_kind::legacy); } else if (_group0->joined_group0()) { - // We are a part of group 0. The _topology_change_kind_enabled flag is maintained from there. - _manage_topology_change_kind_from_group0 = true; + // We are a part of group 0. set_topology_change_kind(upgrade_state_to_topology_op_kind(_topology_state_machine._topology.upgrade_state)); if (_db.local().get_config().force_gossip_topology_changes() && raft_topology_change_enabled()) { throw std::runtime_error("Cannot force gossip topology changes - the cluster is using raft-based topology"); diff --git a/service/storage_service.hh b/service/storage_service.hh index 5e1f034fbe..75457292c8 100644 --- a/service/storage_service.hh +++ b/service/storage_service.hh @@ -809,13 +809,6 @@ private: // After the node successfully joins, the control over the variable is yielded // to `topology_state_load`, so that it can control it during the upgrade from gossiper // based topology to raft-based topology. - // FIXME: This boolean flag is mostly needed because, shortly after starting - // a new group 0, the state of `system.topology` is empty, and updating the - // `_topology_change_kind_enabled` variable from group 0 state would lead - // to wrong results. This could be fixed by writing an initial `system.topology` - // state before creating the group 0 (also making sure to set the correct - // group 0 state id so that the timestamps of further mutations are correct). - bool _manage_topology_change_kind_from_group0 = false; topology_change_kind _topology_change_kind_enabled = topology_change_kind::unknown; // Throws an exception if the node is either starting and didn't determine which