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 1BF566EC55; Tue, 15 Jun 2021 14:55:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1BF566EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1623758106; bh=hSfwQmBigTCYtzPuIN0EgPurUTIcSzK0l+Vz8+LP8eE=; 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=ACxh1bWugNUd801lTnBGGSa2OC+WQ71jquNCh5LWDu6Gaj28K4upYD1l9jrop8CDR 6Cx9U+21SpiSxaXMrKko6LplR/ujOHaE1pUd1igPNxcp+TEOet1YGRSjUjd4XrhJ9n aWEhtETjGWoUFX1zZ/kx66wyS8YOpbipzIPj8s8w= Received: from smtp34.i.mail.ru (smtp34.i.mail.ru [94.100.177.94]) (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 8B70E6EC55 for ; Tue, 15 Jun 2021 14:55:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8B70E6EC55 Received: by smtp34.i.mail.ru with esmtpa (envelope-from ) id 1lt7eq-0003Mr-NU; Tue, 15 Jun 2021 14:55:05 +0300 To: Cyrill Gorcunov , tml Cc: Vladislav Shpilevoy References: <20210611152259.205627-1-gorcunov@gmail.com> <20210611152259.205627-2-gorcunov@gmail.com> <7f270051-995e-f94f-2bda-f2fd065bf59e@tarantool.org> Message-ID: <9a0f867f-f890-7f2a-ab39-05ffbd68b286@tarantool.org> Date: Tue, 15 Jun 2021 14:55:04 +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: <7f270051-995e-f94f-2bda-f2fd065bf59e@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: ru X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D5B0DA836B685C540E30C2BDD69416C6E46C178CD572CB10182A05F53808504005ECD122B6638403D6B194B08FFC5DC8E519ED24A535A1A0321D3CCFC34C55EF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE760302A529BCAAAFCEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063798FF8892961A0B3C8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D848D23D7DDCAE872340388AE924F7B635117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD186FD1C55BDD38FC3FD2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B61F2C8E835678F328089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A50D1752A6ECFB505E8CB6F857094FD8F2611E3DD7028BED88D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75FBC5FED0552DA851410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AA13E2DDB9067862AF388D6DFA44943E9FBAA257C367E05777A4FE8713A8809BBBBC6A8CC9FF43E31D7E09C32AA3244C102E2BF8691EA5621E9DFA0EC99C0438408A6A02710B7304FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj6OL1iHTyIM0PTg1fNOE07Q== X-Mailru-Sender: 3B9A0136629DC9125D61937A2360A446743BC207F7079288B1A34F11CD0E3366C2106363C70C6AB2424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 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" 15.06.2021 14:35, Serge Petrenko via 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: Pushed the diff on top of your branch as a separate commit. > ================================================= > > 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