From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.mail.ru (smtp1.mail.ru [94.100.179.111]) (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 E37A6445320 for ; Sun, 5 Jul 2020 18:13:22 +0300 (MSK) References: <4e2a3c4e8c51bf6eabf37713e4b34d18e15283c5.1593733161.git.v.shpilevoy@tarantool.org> <2f0e1f4d-d4f4-7cff-c0c1-5e906f02bfbf@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Sun, 5 Jul 2020 17:13:20 +0200 MIME-Version: 1.0 In-Reply-To: <2f0e1f4d-d4f4-7cff-c0c1-5e906f02bfbf@tarantool.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Tarantool-patches] [PATCH 5/5] [tosquash] replication: add test on local row in the end of sync txn List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Petrenko , tarantool-patches@dev.tarantool.org >> diff --git a/test/replication/qsync_basic.test.lua b/test/replication/qsync_basic.test.lua >> index 6e40131bf..74083a0b9 100644 >> --- a/test/replication/qsync_basic.test.lua >> +++ b/test/replication/qsync_basic.test.lua >> @@ -163,6 +163,26 @@ box.space.sync:select{9} >>   box.space.locallocal:select{9} >>   box.space.test:select{9} >>   +-- >> +-- gh-4928: test that a sync transaction works fine with local >> +-- rows in the end. >> +-- >> + >> +-- test_run:switch('default') >> +-- box.cfg{replication_synchro_timeout = 1000, replication_synchro_quorum = 2} >> +-- do                                                                              \ >> +--     box.begin()                                                                 \ >> +--     box.space.sync:replace{10}                                                  \ >> +--     box.space.locallocal:replace({10})                                          \ >> +--     box.commit()                                                                \ >> +-- end >> +-- box.space.sync:select{10} >> +-- box.space.locallocal:select{10} >> + >> +-- test_run:switch('replica') >> +-- box.space.sync:select{10} >> +-- box.space.locallocal:select{10} >> + >>   -- >>   -- gh-5123: quorum 1 still should write CONFIRM. >>   -- > Hi! Thanks for the test! > LGTM with one comment. > > Looks like it relies on the vclock[0] increase you performed in > the previous test (patch 4/5). Yup. > If it wasn't for this increase,both correctly and incorrectly > working tarantools would complete the transaction. (The incorrect > one would take lsn = 1 from vclock[0]) > > Maybe add the same increase here, to make sure the test stays > valid if someone changes the previous test case? Ok, fair. I also reduced the first bump count, to speed up the test a bit. ==================== diff --git a/test/replication/qsync_basic.result b/test/replication/qsync_basic.result index 83ff7d3d1..3e28607b0 100644 --- a/test/replication/qsync_basic.result +++ b/test/replication/qsync_basic.result @@ -317,7 +317,7 @@ _ = _:create_index('pk') | ... -- Propagate local vclock to some insane value to ensure it won't -- affect anything. -box.begin() for i = 1, 2000 do box.space.locallocal:replace{1} end box.commit() +box.begin() for i = 1, 500 do box.space.locallocal:replace{1} end box.commit() | --- | ... do \ @@ -426,6 +426,9 @@ box.space.test:select{9} -- test_run:switch('default') -- box.cfg{replication_synchro_timeout = 1000, replication_synchro_quorum = 2} +-- -- Propagate local vclock to some insane value to ensure it won't +-- -- affect anything. +-- box.begin() for i = 1, 500 do box.space.locallocal:replace{1} end box.commit() -- do \ -- box.begin() \ -- box.space.sync:replace{10} \ diff --git a/test/replication/qsync_basic.test.lua b/test/replication/qsync_basic.test.lua index 74083a0b9..860d6d6c4 100644 --- a/test/replication/qsync_basic.test.lua +++ b/test/replication/qsync_basic.test.lua @@ -127,7 +127,7 @@ _ = box.schema.create_space('locallocal', {is_local = true}) _ = _:create_index('pk') -- Propagate local vclock to some insane value to ensure it won't -- affect anything. -box.begin() for i = 1, 2000 do box.space.locallocal:replace{1} end box.commit() +box.begin() for i = 1, 500 do box.space.locallocal:replace{1} end box.commit() do \ f1 = fiber.create(box.space.sync.replace, box.space.sync, {8}) \ f2 = fiber.create(box.space.locallocal.replace, box.space.locallocal, {8}) \ @@ -170,6 +170,9 @@ box.space.test:select{9} -- test_run:switch('default') -- box.cfg{replication_synchro_timeout = 1000, replication_synchro_quorum = 2} +-- -- Propagate local vclock to some insane value to ensure it won't +-- -- affect anything. +-- box.begin() for i = 1, 500 do box.space.locallocal:replace{1} end box.commit() -- do \ -- box.begin() \ -- box.space.sync:replace{10}