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 15EFB6EC5F; Wed, 21 Apr 2021 09:00:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 15EFB6EC5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618984800; bh=ItCGDNN8Jv1g6PyhVJklPJIJpV+pVmPgQluru673GnM=; 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=osGVZ9ZJM3Sb2anZ4UIYQon9fgxKPi+COAVd/JvQCoJu+MNngJfQEMcRQetGJP3JN 3CWMQ7i4/aFutT/AqLnMhh9+3c0FP2rWOQGBWmEMBnD2iFEwko8TcupFiaNb+CbZq9 SkJL1RcuG3HGinLzQf4d6icE84MKNeNnna0lPHiM= Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [94.100.177.99]) (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 D36A36F3C4 for ; Wed, 21 Apr 2021 08:59:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D36A36F3C4 Received: by smtp39.i.mail.ru with esmtpa (envelope-from ) id 1lZ5th-0002Da-6m; Wed, 21 Apr 2021 08:59:37 +0300 To: Vladislav Shpilevoy , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <44f6cb10-ed92-49ed-e4de-783b7a698e42@tarantool.org> Message-ID: Date: Wed, 21 Apr 2021 08:59:36 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: ru X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E7480257C85EA0BB7A95D0F00AE41BB9A5343182A05F5380850408F6118567A7CD0C61CDDE9ADF1B4C15FC20FCCABF91701A9C6916899F06F18DD X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72B221FD723B94806EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006374D78D7F7271F09E9EA1F7E6F0F101C67CDEEF6D7F21E0D1D9295C2E9FA3191EE1B59CA4C82EFA6584AA900F22AEF13863E7403FF90EAB468F6B57BC7E64490618DEB871D839B73339E8FC8737B5C22496EA1BA7CA28B4A74CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0AF05157F0BAFB9978941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD2691661749BA6B977350A540ACCDD6F8BF67B076A6E789B0E97A8DF7F3B2552694A1E7802607F20496D49FD398EE364050FB1593CA6EC85F86D7AAF5A6EB0CB4C2AB3661434B16C20AC39D6185B782DDB68E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B9149C560DC76099D75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24209795067102C07E8F7B195E1C978310342C5F346BA93007A82484DD75C3D90 X-C1DE0DAB: 0D63561A33F958A534279673CE6AEA04CAE02B03DB3B037C8DA3033812251AAFD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3467D08F30473A5842BDECE5C565688BD9F5092FA3B0CB4963BDA58970284C829D01711AA31AD78B7A1D7E09C32AA3244C8F57C94B3A9B81DFC8DE4783A3A802093E8609A02908F271FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojlPRl29Bx4WFh/+keeNDpBQ== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F8F7DA7E4D73C7A60E392D8075559862126D80FFBE066E7F2C424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v4 14/12] txn: make NOPs fully asynchronous 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" 21.04.2021 01:31, Vladislav Shpilevoy пишет: > Thanks for the patch! > > I added a test + an explanation in the comments in my commit. See > below and on the branch (sp/gh-5445-election-fixes-review): Looks good, squashed as well. > > ==================== > [tosquash] Add reason and test for nop limbo bypass > > diff --git a/src/box/txn.c b/src/box/txn.c > index 8be102666..03b39e0de 100644 > --- a/src/box/txn.c > +++ b/src/box/txn.c > @@ -603,7 +603,10 @@ txn_journal_entry_new(struct txn *txn) > bool is_sync = false; > /* > * A transaction which consists of NOPs solely should pass through the > - * limbo without waiting. Even when the limbo is not empty. > + * limbo without waiting. Even when the limbo is not empty. This is > + * because otherwise they might fail with the limbo being not owned by > + * the NOPs owner. But it does not matter, because they just need to > + * bump vclock. There is nothing to confirm or rollback in them. > */ > bool is_fully_nop = true; > > diff --git a/test/replication/qsync_basic.result b/test/replication/qsync_basic.result > index 3457d2cc9..7e711ba13 100644 > --- a/test/replication/qsync_basic.result > +++ b/test/replication/qsync_basic.result > @@ -637,6 +637,67 @@ box.space.sync:count() > | - 0 > | ... > > +-- > +-- gh-5445: NOPs bypass the limbo for the sake of vclock bumps from foreign > +-- instances, but also works for local rows. > +-- > +test_run:switch('default') > + | --- > + | - true > + | ... > +box.cfg{replication_synchro_quorum = 3, replication_synchro_timeout = 1000} > + | --- > + | ... > +f = fiber.create(function() box.space.sync:replace{1} end) > + | --- > + | ... > +test_run:wait_lsn('replica', 'default') > + | --- > + | ... > + > +test_run:switch('replica') > + | --- > + | - true > + | ... > +function skip_row() return nil end > + | --- > + | ... > +old_lsn = box.info.lsn > + | --- > + | ... > +_ = box.space.sync:before_replace(skip_row) > + | --- > + | ... > +box.space.sync:replace{2} > + | --- > + | ... > +box.space.sync:before_replace(nil, skip_row) > + | --- > + | ... > +assert(box.space.sync:get{2} == nil) > + | --- > + | - true > + | ... > +assert(box.space.sync:get{1} ~= nil) > + | --- > + | - true > + | ... > + > +test_run:switch('default') > + | --- > + | - true > + | ... > +box.cfg{replication_synchro_quorum = 2} > + | --- > + | ... > +test_run:wait_cond(function() return f:status() == 'dead' end) > + | --- > + | - true > + | ... > +box.space.sync:truncate() > + | --- > + | ... > + > -- > -- gh-5191: test box.info.synchro interface. For > -- this sake we stop the replica and initiate data > diff --git a/test/replication/qsync_basic.test.lua b/test/replication/qsync_basic.test.lua > index a604d80ee..75c9b222b 100644 > --- a/test/replication/qsync_basic.test.lua > +++ b/test/replication/qsync_basic.test.lua > @@ -248,6 +248,29 @@ for i = 1, 100 do box.space.sync:delete{i} end > test_run:cmd('switch replica') > box.space.sync:count() > > +-- > +-- gh-5445: NOPs bypass the limbo for the sake of vclock bumps from foreign > +-- instances, but also works for local rows. > +-- > +test_run:switch('default') > +box.cfg{replication_synchro_quorum = 3, replication_synchro_timeout = 1000} > +f = fiber.create(function() box.space.sync:replace{1} end) > +test_run:wait_lsn('replica', 'default') > + > +test_run:switch('replica') > +function skip_row() return nil end > +old_lsn = box.info.lsn > +_ = box.space.sync:before_replace(skip_row) > +box.space.sync:replace{2} > +box.space.sync:before_replace(nil, skip_row) > +assert(box.space.sync:get{2} == nil) > +assert(box.space.sync:get{1} ~= nil) > + > +test_run:switch('default') > +box.cfg{replication_synchro_quorum = 2} > +test_run:wait_cond(function() return f:status() == 'dead' end) > +box.space.sync:truncate() > + > -- > -- gh-5191: test box.info.synchro interface. For > -- this sake we stop the replica and initiate data -- Serge Petrenko