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 2E72D6EC55; Thu, 22 Jul 2021 00:43:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2E72D6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626903804; bh=XxCYxSCCPkFbNphOsbg4vvbuR1HSkblgajU5rfb6Ey0=; 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=iybwVOS3vkoHgA8G8OtT+z2rT0IuftyQBhYcG0U9mlelC0E6YVVk0R3ztdZ1s0sda 3AiMiNWRmNUVi7Zz0k4KxkKj4ykHy9XrqEfE4DKCsr+Nz7lRjnj8H/AhPYbnDyswwR PrBAkyKn3ISupmbioctx0J94IPzuFLd+o2bh754A= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [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 02DC06EC55 for ; Thu, 22 Jul 2021 00:43:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 02DC06EC55 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1m6Jzt-0000VH-72; Thu, 22 Jul 2021 00:43:21 +0300 To: Konstantin Osipov , Cyrill Gorcunov , tarantool-patches@dev.tarantool.org, sergepetrenko@tarantool.org References: <0c92a88ff1d392f8b03de59be8cb19a162bf78f8.1626392372.git.v.shpilevoy@tarantool.org> <20210716142959.GC146960@starling> <20210719091248.GA4257@starling> <20210720232057.GA85781@starling> Message-ID: <478f6e48-3150-614d-0006-6a1f54d883fb@tarantool.org> Date: Wed, 21 Jul 2021 23:43:20 +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: <20210720232057.GA85781@starling> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD941C43E597735A9C386C8E0DDEE7E2465E4A01A82547D9FE1182A05F53808504093147DC62337E1610E01678FFDD2D434D65D913AEC1B9B3F68A66BBA90C46824 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73F94C36969B178B8EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637790A9327A9AFEF4F8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D808C4B07F2F85284610C93A8C387DE891117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC60CDF180582EB8FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751F6FD1C55BDD38FC3FD2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B613439FA09F3DCB32089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5E5B2B48EA507B1041FBEF2192EA30B064D3D815F70ADAF7FD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7501A9DF589746230F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D346B71C4B0698719D75C9197B2215121C1B2CC5F12DCCC52501AE5CC3A49E85B2BFB41716B43AADB541D7E09C32AA3244CD299A3C8A6CC3F2E60856E502B9AD27497FE24653F78E668927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojaAaPr+N/4d06+MvRu8Qvqw== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5DF9F146E0EA3C7D4DD238D8FE3B8AE38D3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 1/2] replication: introduce ballot.can_be_leader 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" >> A B C D E >> {-, -, 4, 3, 3} >> F F V >> >> Now the node E can vote for C and D because its index is LE. >> And since C's index is bigger than others it will be elected >> next as far as I understand, no? > > You're right, assuming the voter never casts a vote for a > candidate with a shorter log the safety is not violated. I wasn't > sure it's the case, and presumed that the voter may have no log of > its own. But still there are issues with liveness. Raft PHD has > learners, so why not use them instead. Because I didn't think of that before. It seems we need learners. Otherwise when a cluster is started with a single node, an attempt to add a second node will make the first one not able to commit anything, because it won't be able to gather a quorum for its sync transactions, nor won't even be elected as a leader again until the second node finishes recovery. We probably could make all new nodes learners automatically at least until they finish both join stages. Or make it manual, don't know yet. Anyway, the main problem I see right away is that the learner role means we can't just get `_cluster:count() / 2 + 1` as a quorum value. Because not all registered nodes participate in quorum. Later I will create a ticket for that learner feature.