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 74E7A6EC55; Sun, 18 Jul 2021 20:02:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 74E7A6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626627723; bh=G81vZpoPTTBo7DE47riB9/5/kW7CDsxltGAK9/rD68g=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=zfj8cRkGS+ySgYthIBBKvQnIYHnszyB5JvSP2g0oCAX0B+iEOL736iTdrKeCqK1OV CwgfFTv91TJ33PQ45aWxVpKcTagOexcPdaz2dViP1IZ2AbjS97eG3+qtU9XfQDiMe9 XPgGd71GLQFak7EaNO596i5wfCIM/5eGFuL9ws3w= Received: from smtpng2.i.mail.ru (smtpng2.i.mail.ru [94.100.179.3]) (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 A21B26EC5A for ; Sun, 18 Jul 2021 20:00:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A21B26EC5A Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1m5A9y-0007y3-0X; Sun, 18 Jul 2021 20:00:58 +0300 To: Konstantin Osipov , tarantool-patches@dev.tarantool.org, gorcunov@gmail.com, sergepetrenko@tarantool.org References: <20210716142750.GB146960@starling> Message-ID: Date: Sun, 18 Jul 2021 19:00:56 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210716142750.GB146960@starling> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD941C43E597735A9C386C8E0DDEE7E2465E4A01A82547D9FE1182A05F53808504038BF56B025A0FC154193574461CA507B72A959FF8C8C0F1A752DDBD312FD1D5B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F157A19638F32F60EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063702DFA59B3C994360EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BBCA57AF85F7723F281B7FCE120E200CAC93C92BC9A2EF3C2CC7F00164DA146DAFE8445B8C89999728AA50765F79006372A3B24BF85B2E607389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8D2A98E5A6551E3E5117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637BC468E7E89D8C5D6EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A58698AC6DC6953DE6CC92AA1BC5A766D38B6C4F9F6697987BD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7501A9DF589746230F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D344B4608D01B1CB59A911BE7CC234E449BDD24DE35C7A9A903A0C071E545C889FA443D02409BEA8FE71D7E09C32AA3244C9664D2479B90E769D474ADA459D2C08830452B15D76AEC14927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj+8+KVR9NZrEZXxyM6gDuag== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D63AC7CA5DFAC50E90B6C2EA57E7722D83841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 0/2] Bootstrap voter 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" Thanks for the help proposal! On 16.07.2021 16:27, Konstantin Osipov wrote: > * Vladislav Shpilevoy via Tarantool-patches [21/07/16 11:23]: >> In the patch I don't like this start/stop_candidate() calls. They look bulky. >> I wanted to replace them with a function like raft_try_candidate() which would >> make the instance a candidate for one current term. >> >> Also I don't like box_raft_wait_leader_found() in bootstrap. Even though it >> should always succeed in a couple of WAL writes. >> >> The only problem with having a one-term try_candidate() is the split vote in >> box_promote(). There between start_candidate() and stop_candidate() several >> terms can pass if they end without a leader elected. I want to keep this >> working. But I couldn't find a simple way to make raft_try_candidate() work like >> that. >> >> Nor I could find a nice way to retry the candidate attempts in box_promote(). >> In the end, if box_raft_wait_leader_found() fails, you need to restore the >> candidate state. And this leads to having some kind of start/stop_candidate >> anyway. >> >> If you have ideas how to make it look better, I am looking forward to hearing >> it. >> > > I'd be happy to help but I don't understand the motivation from > this commit comment. I asked for ideas how to get rid of raft_start/stop_candidate(). The motivation is to keep the code clearer. In v2 I think I managed to achieve it.