From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id EC8DD6ECE3; Tue, 18 Jan 2022 16:21:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EC8DD6ECE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1642512115; bh=gQLRhWAPvZn0RcP3ooxrRAHMUZUqWtvsfydCq90IkUQ=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=VY4gJHQlvMAKkj4JJsH+iLkHbE5PO9amwux6fQHjmD8qimSbv221EUAz59dVZXBx5 6KqXr0qAeyVXoAkPOQ9EWL4sXULVtmeNMHQTDqH+t9coBCyfDdqL+YJVM40GK4Fy+u GKbr+CvFpMeTkUV8a2Ab4s+f3zFu71bso4bYWQ6s= Received: from smtp42.i.mail.ru (smtp42.i.mail.ru [94.100.177.102]) (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 A74806ECE3 for ; Tue, 18 Jan 2022 16:21:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A74806ECE3 Received: by smtp42.i.mail.ru with esmtpa (envelope-from ) id 1n9oQr-0000Dg-3c; Tue, 18 Jan 2022 16:21:53 +0300 Message-ID: <0477f8c4-344d-eed0-9f88-e3f6097342e5@tarantool.org> Date: Tue, 18 Jan 2022 16:21:52 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org References: Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9674A2F03CC160474DDF5F9DFAC6E4CBE10368D414F8F571F182A05F53808504036831E7A6EA60D1CE57AFC1C4C4A34E859ED4F47484FD0225EA50A8F6ABA475D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7922D113DFDC6D5A3EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637B05885A782BE20C5EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BEBC5CAB6D411FFA6B2628A1431111EBE6C9806EB875838ADCC7F00164DA146DAFE8445B8C89999728AA50765F7900637DCE3DBD6F8E38AFD389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC80A9EC8C3488E7643F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C6FF1B927F95F3316AD7EC71F1DB884274AD6D5ED66289B52698AB9A7B718F8C46E0066C2D8992A16725E5C173C3A84C3456F507CAE568110BA3038C0950A5D36B5C8C57E37DE458B0BC6067A898B09E46D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7E1BCFB2C0BE3F189731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5EFFF94B04BB207B341348DD9BC9A333359614718207B4838D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7506FE1F977233B9BB410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34B5900AD87B4159A48C6A0F959921C99DC213668490C4B31FDB87D5730CCB6EFC966F03BD161C7DC61D7E09C32AA3244C93C7DDCBC4F1A76727073BE421CACD54A8CE788DE6831205729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojvTjFtNOxqHC4jOt0MxivuQ== X-Mailru-Sender: 583F1D7ACE8F49BD7B46BC6C7C9DD5A8CB2993FEEDF36571277BF71842DE3D9B522E5A9FE53339C8424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BCB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 4/4] election: activate raft split vote handling X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 15.01.2022 03:48, Vladislav Shpilevoy пишет: > Raft needs to know cluster size in order to detect and handle > split vote. The patch uses registered server count as cluster > size. > > It is not documented nor has a changelog file because this is an > optimization. Can't be observed except in logs or with a watch. > > Closes #5285 Thanks for working on this! Please, find one comment below. > --- > src/box/raft.c | 4 +- > .../election_split_vote_test.lua | 92 +++++++++++++++++++ > 2 files changed, 95 insertions(+), 1 deletion(-) > create mode 100644 test/replication-luatest/election_split_vote_test.lua > > diff --git a/src/box/raft.c b/src/box/raft.c > index 1e360dc88..1908b71b6 100644 > --- a/src/box/raft.c > +++ b/src/box/raft.c > @@ -229,7 +229,9 @@ box_raft_update_election_quorum(void) > * be lost. > */ > int quorum = MIN(replication_synchro_quorum, max); > - raft_cfg_election_quorum(box_raft(), quorum); > + struct raft *raft = box_raft(); > + raft_cfg_election_quorum(raft, quorum); > + raft_cfg_cluster_size(raft, replicaset.registered_count); Better use `max` instead of `replicaset.registered_count` here. I don't think something could go wrong with setting cluster size to zero initially, but let's better avoid that. > } > > void ... -- Serge Petrenko