mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-02 06:05:53 +00:00
raft: joint consensus, switch configuration to joint
In order to work correctly in transitional configuration, participants must enter it after crashes, restarts and state changes. This means it must be stored in Raft log and snapshot on the leader and followers. This is most easily done if transitional configuration is just a flavour of standard configuration. In FSM, rename _current_config to _configuration, it now contains both current and future configuration at all times.
This commit is contained in:
@@ -324,11 +324,11 @@ future<std::vector<std::pair<std::unique_ptr<raft::server>, state_machine*>>> cr
|
||||
|
||||
for (size_t i = 0; i < states.size(); i++) {
|
||||
auto uuid = utils::UUID(0, i + 1); // Custom sequential debug id; 0 is invalid
|
||||
config.servers.push_back(raft::server_address{uuid});
|
||||
config.current.push_back(raft::server_address{uuid});
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < states.size(); i++) {
|
||||
auto& s = config.servers[i];
|
||||
auto& s = config.current[i];
|
||||
states[i].snapshot.config = config;
|
||||
snapshots[s.id] = states[i].snp_value;
|
||||
auto& raft = *rafts.emplace_back(create_raft_server(s.id, apply, states[i], apply_entries, type)).first;
|
||||
|
||||
Reference in New Issue
Block a user