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 0EDC76EC5F; Mon, 19 Apr 2021 12:32:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0EDC76EC5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618824747; bh=o7iEPyiD+9ekIt8AEBcDaSsemkzNQAORKdMBrXbGVvM=; 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=wIL1CZngstZIt2Zzh6GMihLLmxMMqXb+LNuBFnIxyvi+2PbAdz8K6+R+wyYdzn8Hl bY6AAv692mywZsUtTGdcOWuVrzal+1uXwoL62qbvpi/pANPQxZLer+dKMoC2aPN7GJ GGSmkG+mKTBYyFmt85Og9zCnPaMsokm42ibldnAg= Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (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 B8F7D6EC5F for ; Mon, 19 Apr 2021 12:32:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B8F7D6EC5F Received: by smtp43.i.mail.ru with esmtpa (envelope-from ) id 1lYQGX-0002pw-7x; Mon, 19 Apr 2021 12:32:25 +0300 To: Vladislav Shpilevoy , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <05b14638-53d8-51db-4a85-3adafd611db6@tarantool.org> <5b3ec61c-5790-b27e-9a8c-9964bbcb6b4f@tarantool.org> <4475dc41-7648-d82c-9289-39180cbe9f98@tarantool.org> Message-ID: <27036e8b-3a69-6b63-dfb5-36b22058b10f@tarantool.org> Date: Mon, 19 Apr 2021 12:32:24 +0300 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: <4475dc41-7648-d82c-9289-39180cbe9f98@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E748013307ED7ECCBF4892260E197EB99ED8F182A05F5380850405769D5BA960EC311B41DBEA29F4E3DD84F605289CB1F1EF3FDCBD4360010F058 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE71D4C43A3529EEBE6EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371005780D56A98C20EA1F7E6F0F101C67CDEEF6D7F21E0D1D9295C2E9FA3191EE1B59CA4C82EFA658094E031787731CE19C3A0F4E8E9FDA39F6B57BC7E64490618DEB871D839B73339E8FC8737B5C224936DA1BED736F9328CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C07734D68A6916D8318941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD269176DF2183F8FC7C01908CEABB6907E637B076A6E789B0E97A8DF7F3B2552694A1E7802607F20496D49FD398EE364050F1E561CDFBCA1751F4DC33E588678F033B3661434B16C20AC78D18283394535A9E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B60A62CEF541B197C8089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24209795067102C07E8F7B195E1C97831C3BD87E1CE547DF6E7218EB9B50BAE8A X-C1DE0DAB: 0D63561A33F958A5F47E98E3862EEAE452A80A2EDC7ECA34415AEA39C28E36B5D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D4E96E2A5B1100E06A67E2573AE92C880DE032AAB3E0A14E4DF551C72D81E70CB2403A4DA75F1B1C1D7E09C32AA3244C9725221DB9F06281F40130FCBE3CF8D6F26BFA4C8A6946B8FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojocJA+pXcDuld1GV8IvqDCA== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F881984E1F429DDF161D6102138CAA7229B35B37D116FEEF1D424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 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: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 18.04.2021 19:07, Vladislav Shpilevoy пишет: >>>> +        /* >>>> +         * 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. Besides, now the user may cancel the fiber issuing the promote. > > 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. -- Serge Petrenko