From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 0FB9B469719 for ; Sat, 19 Sep 2020 18:59:46 +0300 (MSK) From: Vladislav Shpilevoy References: <5a7cf2f2-1b7c-28be-688f-d604a64d0623@tarantool.org> Message-ID: <32cfcf23-b723-e959-f2cc-6897431315b9@tarantool.org> Date: Sat, 19 Sep 2020 17:59:44 +0200 MIME-Version: 1.0 In-Reply-To: <5a7cf2f2-1b7c-28be-688f-d604a64d0623@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v2 12/11] dRaft List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, sergepetrenko@tarantool.org, gorcunov@gmail.com 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.