From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [217.69.128.35]) (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 236E6469719 for ; Fri, 6 Nov 2020 13:28:06 +0300 (MSK) References: <20201106083724.508438-1-gorcunov@gmail.com> From: Serge Petrenko Message-ID: Date: Fri, 6 Nov 2020 13:28:01 +0300 MIME-Version: 1.0 In-Reply-To: <20201106083724.508438-1-gorcunov@gmail.com> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: ru Subject: Re: [Tarantool-patches] [PATCH] raft: use vclock_map_t for voting tracking List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov , Vladislav Shpilevoy Cc: tml 06.11.2020 11:37, Cyrill Gorcunov пишет: > We've VCLOCK_MASK constant which limits the number of > regular nodes in a replication cluster. This limit is > bound to the vclock_map_t bitset type. Thus when we're > tacking voting process in Raft node we better use this > type for vote_mask member (otherwise it is a room for > error if we ever change VCLOCK_MASK and extend the width > of a bitset). > > Suggested-by: Vladislav Shpilevoy > Signed-off-by: Cyrill Gorcunov Hi! Thanks for the patch! LGTM. > --- > branch gorcunov/raft-vote-mask > > src/box/raft.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/src/box/raft.h b/src/box/raft.h > index 8293d7410..0e7fe0e85 100644 > --- a/src/box/raft.h > +++ b/src/box/raft.h > @@ -33,6 +33,7 @@ > #include > #include "tarantool_ev.h" > #include "trigger.h" > +#include "vclock.h" > > #if defined(__cplusplus) > extern "C" { > @@ -146,7 +147,7 @@ struct raft { > * Bit 1 on position N means that a vote from instance with ID = N was > * obtained. > */ > - uint32_t vote_mask; > + vclock_map_t vote_mask; > /** Number of votes for this instance. Valid only in candidate state. */ > int vote_count; > /** State machine timed event trigger. */ -- Serge Petrenko