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 002E56EC55; Tue, 15 Jun 2021 14:35:18 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 002E56EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1623756919; bh=IxAGhTVYie0yfJBO53uyg9NPWvkLoV7Iqci1HD9uLOk=; 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=E85kO7Krt5VBQTXWRD/lE4/bstlDq7vDNRTS035fNX9yaqxtMJQzeJfSXSgVo8cCb AmD3np9jQmNyfk41pRJHDbiZ0SXrC8NdkRYk00cSI6FX+TU9g8Pb3pbWbOwJ0pSZ3r t1UwlSIKeycO6mdmw7AXG9cDdke2OjDAk2Lrij2g= Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [94.100.177.92]) (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 849926EC55 for ; Tue, 15 Jun 2021 14:35:17 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 849926EC55 Received: by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1lt7Lg-0001pL-P3; Tue, 15 Jun 2021 14:35:17 +0300 To: Cyrill Gorcunov , tml Cc: Vladislav Shpilevoy References: <20210611152259.205627-1-gorcunov@gmail.com> <20210611152259.205627-2-gorcunov@gmail.com> Message-ID: <7f270051-995e-f94f-2bda-f2fd065bf59e@tarantool.org> Date: Tue, 15 Jun 2021 14:35:16 +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: <20210611152259.205627-2-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D5B0DA836B685C540E30C2BDD69416C6E46C178CD572CB10182A05F5380850408D2D6FF47893A3590E6C687FF8D5EA73400B6DF519C92BEB157CAE1918137970 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70B8ADF238913687CB287FD4696A6DC2FA8DF7F3B2552694A4E2F5AFA99E116B42401471946AA11AF1661749BA6B97735EA3ECAD3D6C466038F08D7030A58E5AD1A62830130A00468AEEEE3FBA3A834EE7353EFBB553375662C9C2AE8C25C43DDC6B4BC5D316B2E391B238803D8FF7447A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE71AE4D56B06699BBC9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C34964A708C60C975A117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F790063723B0D190C46BCD7DEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A59486E03063ECAE7D6353CF413A53CD6F57231DC2263D7E3ED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75FBC5FED0552DA851410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34EE19B6E2433CA093DF914A571AFC839A7001C08191E048D523F4FC428BF0F439E4804FF5F31BCA281D7E09C32AA3244C481BCC69D27CD26002AF9A737564FE946C24832127668422FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj6OL1iHTyIM1Ln9KGGOx3YQ== X-Mailru-Sender: 3B9A0136629DC9125D61937A2360A446321792CB6ADDB2AF908BEB7C8D28C422CFA3ABD02D4A424A424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v8 1/2] applier: filter incoming synchro packets via transaction initiator 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" 11.06.2021 18:22, Cyrill Gorcunov пишет: > Currently we use synchro packets filtration based on their contents, > in particular by their xrow->replica_id value. Still there was a > question if we can optimize this moment and rather filter out all > packets coming from non-leader replica. > > Raft specification requires that only data from a current leader > should be applied to local WAL but doesn't put a concrete claim on > the data transport, ie how exactly rows are reaching replicas. This > implies that data propagation may reach replicas indirectly via transit > hops. Thus we drop applier->instance_id filtering and rely on > xrow->replica_id matching instead. > > In the test (inspired by Serge Petrenko's test) we recreate the situation > where replica3 obtains master's node data (which is a raft leader) > indirectly via replica2 node. > > Closes #6035 > > Signed-off-by: Cyrill Gorcunov > --- > I've found a way to make the test work as discussed: replication 1 <-> 2 -> 3 from the beginning. Without replication reconfiguration. Take a look at the diff below. Although the diff doesn't simplify  anything, and it makes the test run longer: 2.5 s vs 0.8 s on my machine. So it's up to you whether you want to apply it. I'm starting to like your test version more, to be honest. Here's the diff: ================================================= diff --git a/test/replication/gh-6035-applier-filter.result b/test/replication/gh-6035-applier-filter.result index 077cd46e5..4ddebcc6b 100644 --- a/test/replication/gh-6035-applier-filter.result +++ b/test/replication/gh-6035-applier-filter.result @@ -31,7 +31,7 @@ test_run:cmd('create server replica2 with script="replication/gh-6035-replica2.l   | - true   | ... -test_run:cmd('start server master') +test_run:cmd('start server master with wait=False')   | ---   | - true   | ... @@ -44,25 +44,24 @@ test_run:cmd('start server replica2')   | - true   | ... -test_run:switch('replica2') +-- +-- Make the master to be RAFT leader. +test_run:switch('replica1')   | ---   | - true   | ... -box.cfg{replication = {require('fio').cwd() .. "/replica1.sock"}} +box.cfg{election_mode = 'voter'}   | ---   | ... --- --- Make the master to be RAFT leader.  test_run:switch('master')   | ---   | - true   | ... +test_run:wait_lsn('master', 'replica1') + | --- + | ...  box.cfg({                                               \ -    replication = {                                     \ -            require('fio').cwd() .. "/master.sock",     \ -            require('fio').cwd() .. "/replica1.sock",   \ -        },                                              \      replication_synchro_quorum = 2,                     \      election_mode = 'manual',                           \  }) diff --git a/test/replication/gh-6035-applier-filter.test.lua b/test/replication/gh-6035-applier-filter.test.lua index 4e72abe5f..4ec7a6e6a 100644 --- a/test/replication/gh-6035-applier-filter.test.lua +++ b/test/replication/gh-6035-applier-filter.test.lua @@ -19,21 +19,18 @@ test_run:cmd('create server master with script="replication/gh-6035-master.lua"'  test_run:cmd('create server replica1 with script="replication/gh-6035-replica1.lua"')  test_run:cmd('create server replica2 with script="replication/gh-6035-replica2.lua"') -test_run:cmd('start server master') +test_run:cmd('start server master with wait=False')  test_run:cmd('start server replica1')  test_run:cmd('start server replica2') -test_run:switch('replica2') -box.cfg{replication = {require('fio').cwd() .. "/replica1.sock"}} -  --  -- Make the master to be RAFT leader. +test_run:switch('replica1') +box.cfg{election_mode = 'voter'} +  test_run:switch('master') +test_run:wait_lsn('master', 'replica1')  box.cfg({                                               \ -    replication = {                                     \ -            require('fio').cwd() .. "/master.sock",     \ -            require('fio').cwd() .. "/replica1.sock",   \ -        },                                              \      replication_synchro_quorum = 2,                     \      election_mode = 'manual',                           \  }) diff --git a/test/replication/gh-6035-node.lua b/test/replication/gh-6035-node.lua index e3819471a..4ed41b3cf 100644 --- a/test/replication/gh-6035-node.lua +++ b/test/replication/gh-6035-node.lua @@ -10,6 +10,10 @@ require('console').listen(os.getenv('ADMIN'))  if INSTANCE_ID == "master" then      box.cfg({          listen = unix_socket("master"), +        replication = { +            unix_socket("master"), +            unix_socket("replica1") +        },      })  elseif INSTANCE_ID == "replica1" then      box.cfg({ @@ -18,13 +22,12 @@ elseif INSTANCE_ID == "replica1" then              unix_socket("master"),              unix_socket("replica1")          }, -        election_mode = 'voter'      })  else      assert(INSTANCE_ID == "replica2")      box.cfg({          replication = { -            unix_socket("master"), +            unix_socket("replica1"),          },          election_mode = 'voter'      }) ==================================================== -- Serge Petrenko