From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp47.i.mail.ru (smtp47.i.mail.ru [94.100.177.107]) (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 D2240469719 for ; Mon, 21 Sep 2020 10:24:59 +0300 (MSK) References: <5a7cf2f2-1b7c-28be-688f-d604a64d0623@tarantool.org> <32cfcf23-b723-e959-f2cc-6897431315b9@tarantool.org> From: Serge Petrenko Message-ID: <498ffbd4-95de-19c4-7fd0-5ed1419f589a@tarantool.org> Date: Mon, 21 Sep 2020 10:24:58 +0300 MIME-Version: 1.0 In-Reply-To: <32cfcf23-b723-e959-f2cc-6897431315b9@tarantool.org> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: ru 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: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org, gorcunov@gmail.com 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