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 43C546EC58; Mon, 21 Jun 2021 11:55:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 43C546EC58 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1624265732; bh=HTbyjbw/v+oU+26sZksmX2udhXDttmCuq8BqZ6WyhFQ=; 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=G/9t2Nj32GzHCOf6z9q0Md4f0DYcd6XOG+6J4gSbG5zv1QimZwhmYVdCU9veW/Wa8 K302uTvaT5cnNkNkAFi1vl0BwJRneKFyT8a0OVCJh0Gb0vI7mBXTT1oPTdWvKiwekW aWVmsVyvoWVtrx4P17O7N5vRZEM6m4y7ul3ddJ14= 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 21C026EC58 for ; Mon, 21 Jun 2021 11:55:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 21C026EC58 Received: by smtp54.i.mail.ru with esmtpa (envelope-from ) id 1lvFiM-0007I6-Dg; Mon, 21 Jun 2021 11:55:30 +0300 To: Vladislav Shpilevoy , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <9e9aa0e6-36af-bdd5-bf8b-e0e5e07195f7@tarantool.org> Message-ID: <84dbc62c-6ed1-4d07-ba3b-83a2f69f523a@tarantool.org> Date: Mon, 21 Jun 2021 11:55:30 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD91C2C07775F13263AFA27A2C0BAE5D906003D228FC84EF29400894C459B0CD1B9CBD74332338F5921F26EAA12FAB6455D0C9B9455B9088D9A67A9CA496E58B691 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7AB5815F4DE05345AEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CF05F7050DCA185A8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8CC8D93BCC1C3C70859AE3F8EA80C5CE7117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF80095D1E57F4578A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520B1593CA6EC85F86DF04B652EEC242312D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6753C3A5E0A5AB5B7089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A545CC4404469476FD35E2DB9FD52514E37DF03EECB07794F8D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D346840168BCAD8054E1DE6E0A733CF2106A1926F3403042AEBE36166E4A1D5500195CF08DAB5A27E881D7E09C32AA3244C03614A41538AB163B872997AAD21DAD87C0C08F7987826B9FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj8x+Gb+jwA+T9RzRPvVD6xg== X-Mailru-Sender: 3B9A0136629DC9125D61937A2360A4465362DDE455FA721E478254EBD252D3BEF6936034E9F5997B424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 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" 19.06.2021 01:49, Vladislav Shpilevoy пишет: > Hi! Thanks for the fixes! > >> 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. > What if they issue multiple promotes for the same term > 1? They could have > elections enabled, then the term was bumped a few times, then elections were > turned off again. Next promotes will use the current term which is > 1, > won't they? Yes, they will. But such promotes must be filtered out because we can't  be sure if they were issued with or without elections. I still think we need some compatibility with old instances. At least for the case when no elections were used at all. >> 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