[Tarantool-patches] [PATCH v2 12/11] dRaft
Serge Petrenko
sergepetrenko at tarantool.org
Mon Sep 21 10:24:58 MSK 2020
19.09.2020 18:59, Vladislav Shpilevoy пишет:
> My changes on top of this commit are below.
> These are slightly reworked version of Sergey's fixes.
>
> ====================
> [tosquash] raft: keep testing votes, but without relying on 0
>
> diff --git a/test/replication/raft_basic.result b/test/replication/raft_basic.result
> index cff710e24..2996fe3eb 100644
> --- a/test/replication/raft_basic.result
> +++ b/test/replication/raft_basic.result
> @@ -46,9 +46,8 @@ box.cfg{raft_election_timeout = 0}
> term = box.info.raft.term
> | ---
> | ...
> -assert(box.info.raft.vote == 0)
> +vote = box.info.raft.vote
> | ---
> - | - true
> | ...
> assert(box.info.raft.state == 'follower')
> | ---
> @@ -85,7 +84,7 @@ assert(box.info.raft.term == term)
> | ---
> | - true
> | ...
> -assert(box.info.raft.vote == 0)
> +assert(box.info.raft.vote == vote)
> | ---
> | - true
> | ...
> diff --git a/test/replication/raft_basic.test.lua b/test/replication/raft_basic.test.lua
> index faf3ad107..7e7568991 100644
> --- a/test/replication/raft_basic.test.lua
> +++ b/test/replication/raft_basic.test.lua
> @@ -19,7 +19,7 @@ box.cfg{raft_election_timeout = 0}
> -- When Raft is disabled, the instance is a follower. Does not
> -- try to become a leader, and does not block write operations.
> term = box.info.raft.term
> -assert(box.info.raft.vote == 0)
> +vote = box.info.raft.vote
> assert(box.info.raft.state == 'follower')
> assert(box.info.raft.leader == 0)
> assert(not box.info.ro)
> @@ -33,7 +33,7 @@ assert(box.info.ro)
> -- Term is not changed, because the instance can't be a candidate,
> -- and therefore didn't try to vote nor to bump the term.
> assert(box.info.raft.term == term)
> -assert(box.info.raft.vote == 0)
> +assert(box.info.raft.vote == vote)
> assert(box.info.raft.leader == 0)
>
> -- Candidate instance votes immediately, if sees no leader.
LGTM.
--
Serge Petrenko
More information about the Tarantool-patches
mailing list