mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-21 00:50:35 +00:00
At some points while bootstrapping [1], new non-seed Scylla nodes wait for schema agreement among all known endpoints in the cluster. The check for schema agreement was in `service::migration_manager::is_ready_for_bootstrap`. This function would return `true` if, at the time of its invocation, the node was aware of at least one `UP` peer (not itself) and that all `UP` peers had the same schema version as the node. We wish to re-use this check in the `auth` sub-system to ensure that the schema for internal system tables used for access-control have propagated to the entire cluster. Unlike in `service/storage_service.cc`, where `is_ready_for_bootstrap` was only invoked for seed nodes, we wish to wait for schema agreement for all nodes regardless of whether or not they are seeds. For a single-node cluster with itself as a seed, `is_ready_for_bootstrap` would always return `false`. We therefore change the conditions for schema agreement. Schema agreement is now reached when there are no known peers (so the endpoint map of the gossiper consists only of ourselves), or when there is at least one `UP` peer and all `UP` peers have the same schema version as us. This change should not impact any bootstrap behavior in `storage_service` because seed nodes do not invoke the function and non-seed nodes wait for peer visibility before checking for schema agreement. Since this function is no longer checking for schema agreement only in the context of bootstrapping non-seed nodes, we rename it to reflect its generality. [1] http://thelastpickle.com/blog/2017/05/23/auto-bootstrapping-part1.html