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 9100D6E200; Fri, 18 Jun 2021 00:01:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9100D6E200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1623963672; bh=tWmG2XhBaJi65G9WkEIJPdUH2I7ZDITu7uNLDcnwEnA=; 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=Mz6mOkgOyW8H5XUOE9HWZFb5+jPnDuzXD4ATZQiLVMgK6HY5ggbSxIqoeSm81nSWS P9QRaG2qukSGnjyfMOpQ7e4CFT8UJ0ffB7fD4u0/1rSGev3JX5v4tgwyGplT9qbctF N6xJmJXqae5O1ai+8MFkt2B3UwCPkpbj02QjRnvs= Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (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 7E5DD6E203 for ; Fri, 18 Jun 2021 00:00:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7E5DD6E203 Received: by smtp54.i.mail.ru with esmtpa (envelope-from ) id 1ltz7T-0004AR-PP; Fri, 18 Jun 2021 00:00:12 +0300 To: Vladislav Shpilevoy , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <9e9aa0e6-36af-bdd5-bf8b-e0e5e07195f7@tarantool.org> Message-ID: Date: Fri, 18 Jun 2021 00:00:11 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <9e9aa0e6-36af-bdd5-bf8b-e0e5e07195f7@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD91C2C07775F13263AD4A2A3BFBC817E640615893838B9A94F00894C459B0CD1B9DCD0BEC9381777F53A39172A999B08E7AE11324F96DF83CB02E4B84EAC0F4FAA X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE74EB183AD45C8BEFBEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E893C22CB255350D8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D86DAEE9B55C4C4C5DFDD145E731D060B4117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8C7ADC89C2F0B2A5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352026055571C92BF10FF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C6D3A1509E111371103F1AB874ED890284AD6D5ED66289B52698AB9A7B718F8C46E0066C2D8992A16725E5C173C3A84C318264FC03A346C19BA3038C0950A5D36B5C8C57E37DE458B0BC6067A898B09E46D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7B2B7C64F398C7410731C566533BA786AA5CC5B56E945C8DA X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24209795067102C07E8F7B195E1C97831A901C9B9640CA030B56C7EC614AE688F X-C1DE0DAB: 0D63561A33F958A5D8D8C69D1266258FD38E8672160E1840B87535432FCD63EAD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D342B1F2AD168155B06683854861CCCAA8D17D26AA4B1F5240A0F2DADF4860544DAD3E0CA29944598A11D7E09C32AA3244C2CBBAB8A38CCF5690FE3F45F7FC1AD4951E887DA02A9F7BFFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojo2TEchKDd+dOci67XoLdRg== X-Mailru-Sender: 583F1D7ACE8F49BD9DF7A8DAE6E2B08A7335C388A1FBB6A38BCE261B2A095CC5C471291C1F380BA1424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 3/7] txn_limbo: fix promote term filtering 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.06.2021 23:57, Vladislav Shpilevoy пишет: > Thanks for the patch! > > On 10.06.2021 15:32, Serge Petrenko via Tarantool-patches wrote: >> txn_limbo_process() used to filter out promote requests whose term was >> equal to the greatest term seen. This wasn't correct for PROMOTE entries >> with term 1. >> >> Such entries appear after box.ctl.promote() is issued on an instance >> with disabled elections. Every PROMOTE entry from such an instance has >> term 1, but should still be applied. Fix this in the patch. > Didn't we agree that PROMOTE should bump the term always? I see no purpose > for the PROMOTE which never bumps the term except for the tests, but for > such occasion it would be better to have internal.make_leader() or something > which bypasses everything. Although the best option would to bump the term > always. > > I see you did something in the last commit about that, but the part > about `limbo->promote_greatest_term > 1` still remains. It looks very > illegal to point out some terms as "special". What about old instances? They may issue multiple promotes for the same term when elections are off. Previous behaviour (wrong, because we forgot to filter out too old promotes at all) made the instance apply all such promotes. I thought we should allow multiple promotes, at least for the default term (1), which happen only when elections are turned off and have never been turned on. Otherwise, having a new instance together with the old one in the same cluster, you'll have one of them apply all the promotes for one term, and have one dataset, and the other ignore all but the first promote, and have possibly different data. I did fix the issue in the last commit. All the new instances will issue promotes with increasing term each time, and the term will be >= 2. So all the promotes with term == 1 surely will be from the old instances. -- Serge Petrenko