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 6254D6EC5F; Sun, 18 Apr 2021 19:07:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6254D6EC5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618762061; bh=2iXcH5g4K0aDBjQaTJ0yY7+LO8b9nSw9L0RKe9FqFxE=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=DqHAWBeX3xtcxptesAGWegNrqQhQ0TZREH4xqgpHTLflgVTUt6VYNzZl+1b+9yKTC gr/AtSijD6gJVA2xO7+aCmMRCrC4oqYVpQbLL7w2sTwkhsSP0ApeDS6bwhOqdp0HIC FHrhRIv/xjun1GpzNelWlgUD8bILvq4QzpHdO5ks= Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 DD9816EC5F for ; Sun, 18 Apr 2021 19:07:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DD9816EC5F Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1lY9xT-0002qY-3v; Sun, 18 Apr 2021 19:07:39 +0300 To: Serge Petrenko , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <05b14638-53d8-51db-4a85-3adafd611db6@tarantool.org> <5b3ec61c-5790-b27e-9a8c-9964bbcb6b4f@tarantool.org> Message-ID: <4475dc41-7648-d82c-9289-39180cbe9f98@tarantool.org> Date: Sun, 18 Apr 2021 18:07:38 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <5b3ec61c-5790-b27e-9a8c-9964bbcb6b4f@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E74806859AC5FE18436AEED970E897805ADA4182A05F538085040D7CA3CDD3AA240BB6EEB655145A613F9684A8D5423E9DBBB83B621EA0271FB53 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE774A7370C81A54524EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637FA81DCE0280C9CC68F08D7030A58E5ADC58D69EE07B14084F39EFFDF887939037866D6147AF826D8E4A3EF04CFC3ECCA2964A48EE3CB1B8A117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC60CDF180582EB8FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352026055571C92BF10F618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C369456C5265B6C55C35872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C97831F3E73278D7FCC7F967D7C3C64BB55547 X-C1DE0DAB: 0D63561A33F958A5531531C48E04D56B86F8D2C15D797C061E4B2DD1BD456888D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3407FE5477D6A8AF08482C074D8C053B1D9FF79A5F6B240CC897A6BE37F0CFDCC7F8666D254EC2C2EC1D7E09C32AA3244C73873558588F63E8FA39082781AD1FDB60759606DA2E136AFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj1t4H7vLuVFU1U+m4mrOkDg== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638225D85EF7F118AF16D219C09A9BDA0275C3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v4 10/12] election: support manual elections in clear_synchro_queue() 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" >>> +        /* >>> +         * Make this instance a candidate and run until some leader, not >>> +         * necessarily this instance, emerges. >>> +         */ >>> +        raft_start_candidate(box_raft()); >>> +        /* >>> +         * Trigger new elections without waiting for an old leader to >>> +         * disappear. >>> +         */ >>> +        raft_new_term(box_raft()); >>> +        box_raft_wait_leader_found(); >> Shouldn't we wait for election_timeout? > > I think not. Let's wait for however long it takes to elect a leader. > Several terms may pass before the leader is finally elected. > > I mean, IMO it would be simpler for the user to do: > > ``` > box.ctl.promote() >    -- term1, split vote >    -- term2, split vote >    -- term3, leader found > -- success > ``` > rather than > ``` > box.ctl.promote() > -- error, split vote > > box.ctl.promote() > -- error, split vote > > box.ctl.promote() > -- success > ``` The first option looks simpler, but it is infinite, this is the problem. In case of not enough voters alive box.ctl.promote() would hang until there are enough voters. But yeah, split vote is also an issue. Maybe we could leave it like this for now, then make split vote detection, and then wait for a timeout. It should not break backward compatibility.