mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-22 17:40:34 +00:00
This PR implements the functionality of the raft-based cluster features needed to safely manage and enable cluster features, according to the cluster features on raft design doc. Enabling features is a two phase process, performed by the topology coordinator when it notices that there are no topology changes in progress and there are some not-yet enabled features that are declared to be supported by all nodes: 1. First, a global barrier is performed to make sure that all nodes saw and persisted the same state of the `system.topology` table as the coordinator and see the same supported features of all nodes. When booting, nodes are now forbidden to revoke support for a feature if all nodes declare support for it, a successful barrier this makes sure that no node will restart and disable the features. 2. After a successful barrier, the features are marked as enabled in the `system.topology` table. The whole procedure is a group 0 operation and fails if the topology table is modified in the meantime (e.g. some node changes its supported features set). For now, the implementation relies on gossip shadow round check to protect from nodes without all features joining the cluster. In a followup, a new joining procedure will be implemented which involves the topology coordinator and lets it verify joining node's cluster features before the new node is added to group 0 and to the cluster. A set of tests for the new implementation is introduced, containing the same tests as for the non-raft-based cluster feature implementation plus one additional test, specific to this implementation. Closes #14722 * github.com:scylladb/scylladb: test: topology_experimental_raft: cluster feature tests test: topology: fix a skipped test storage_service: add injection to prevent enabling features storage_service: initialize enabled features from first node topology_state_machine: add size(), is_empty() group0_state_machine: enable features when applying cmds/snapshots persistent_feature_enabler: attach to gossip only if not using raft feature_service: enable and check raft cluster features on startup storage_service: provide raft_topology_change_enabled flag from outside storage_service: enable features in topology coordinator storage_service: add barrier_after_feature_update topology_coordinator: exec_global_command: make it optional to retake the guard topology_state_machine: add calculate_not_yet_enabled_features