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 125836EC5F; Wed, 21 Apr 2021 01:32:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 125836EC5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618957935; bh=HlVPz+HEq9y1ngtsLUweEjQYJyMyX9/QR2eUUySHEGM=; 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=aax9YFKzyOrk0EvAGOhRjQHSn4j16c47jZaSmHFHR+7LJ/0bxFqXYaD7sBSAW22xg l572XEnQqXcaiM7r8eYbC6TBqPe1JDyMUU54h3qM8crRPu8Zu1jo04dpMq9FCGPY1g O9Sq6h8g70egwyLnCc3YOs5RPuRIPshCFttwDfNI= Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (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 9976C6EC63 for ; Wed, 21 Apr 2021 01:31:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9976C6EC63 Received: by smtp43.i.mail.ru with esmtpa (envelope-from ) id 1lYytg-0007mi-SD; Wed, 21 Apr 2021 01:31:09 +0300 To: Serge Petrenko , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <44f6cb10-ed92-49ed-e4de-783b7a698e42@tarantool.org> Message-ID: Date: Wed, 21 Apr 2021 00:31:08 +0200 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: <44f6cb10-ed92-49ed-e4de-783b7a698e42@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E748013307ED7ECCBF4892260E197EB99ED8F182A05F53808504023F42309C7B4FCF6E5B26A9B734C6C618C57372CDD7DEF3095F37EBC95F611BE X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE737694D551A905FE2EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E80306D42697F3998638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B22FFE1E1C0829599ACF1669203AD39E3F07164437C8F97EC6D2E47CDBA5A96583C09775C1D3CA48CFBCA4DA3BE1BC1572CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0F04B652EEC242312D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EEC24E1E72F37C03A07AAF5A6EB0CB4C2AD8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE3AD0E433DBF1FBFA3BA3038C0950A5D36B5C8C57E37DE458B0BC6067A898B09E46D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE732FCE54C4D9A645443847C11F186F3C59DAA53EE0834AAEE X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2368A440D3B0F6089093C9A16E5BC824A2A04A2ABAA09D25379311020FFC8D4AD4A55790139E197E644EA1102EA14A14D X-C1DE0DAB: 0D63561A33F958A53C6ADE18C6188184B01C5E8D768129A01DD03CE31A1914E7D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34C786159FDC4342B0AF73E5116381350DC23484355151786934A247C02FB2F11C4D6526EA70E81AF11D7E09C32AA3244C697A47184A6D80CC4E96B1185B48EF3E725D5B54B2FE4575FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojlPRl29Bx4WHkWJ2ID0uDVw== X-Mailru-Sender: 504CC1E875BF3E7D9BC0E5172ADA311094DE23CA03102C423293078FC139E8172DBAA8178A7064BA07784C02288277CA03E0582D3806FB6A5317862B1921BA260ED6CFD6382C13A6112434F685709FCF0DA7A0AF5A3A8387 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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): ==================== [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