mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-30 19:46:48 +00:00
Whether a server can vote in a Raft configuration is not part of the address. `server_address` was used in many context where `can_vote` is irrelevant. Split the struct: `server_address` now contains only `id` and `server_info` as it did before `can_vote` was introduced. Instead we have a `config_member` struct that contains a `server_address` and the `can_vote` field. Also remove an "unsafe" constructor from `server_address` where `id` was provided but `server_info` was not. The constructor was used for tests where `server_info` is irrelevant, but it's important not to forget about the info in production code. Replace the constructor with helper functions which specify in comments that they are supposed to be used in tests or in contexts where `info` doesn't matter (e.g. when checking presence in an `unordered_set`, where the equality operator and hash operate only on the `id`). Closes #11047 * github.com:scylladb/scylla: raft: fsm: fix `entry_size` calculation for config entries raft: split `can_vote` field from `server_address` to separate struct serializer_impl: generalize (de)serialization of `unordered_set` to_string: generalize `operator<<` for `unordered_set`