raft: group 0: use cfg.contains() for config check

There will be nodes in non-voting state in configuration, so can_vote()
is not a good check. Use newer cfg.contains().

Signed-off-by: Alejo Sanchez <alejo.sanchez@scylladb.com>
This commit is contained in:
Alejo Sanchez
2021-12-27 11:20:21 +01:00
parent 627275945f
commit 2d9f40f716

View File

@@ -198,7 +198,7 @@ future<> raft_group0::join_group0() {
co_await grp.persistence.bootstrap(std::move(initial_configuration));
co_await _raft_gr.start_server_for_group(std::move(grp));
}
if (server->get_configuration().can_vote(my_addr.id)) {
if (server->get_configuration().contains(my_addr.id)) {
// True if we started a new group or completed a configuration change
// initiated earlier.
break;