From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp56.i.mail.ru (smtp56.i.mail.ru [217.69.128.36]) (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 605854765E5 for ; Wed, 23 Dec 2020 14:59:52 +0300 (MSK) From: Serge Petrenko Date: Wed, 23 Dec 2020 14:59:23 +0300 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v2 5/6] test: fix replication/election_qsync_stress test List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org The test involves writing synchronous transactions on one node and making other nodes confirm these transactions after its death. In order for the test to work properly we need to make sure the old node replicates all its transactions to peers before killing it. Otherwise once the node is resurrected it'll have newer data, not present on other nodes, which leads to their vclocks being incompatible and noone becoming the new leader and hanging the test. Follow-up #5435 --- test/replication/election_qsync_stress.result | 7 ++++++- test/replication/election_qsync_stress.test.lua | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/test/replication/election_qsync_stress.result b/test/replication/election_qsync_stress.result index 1380c910b..2646995ee 100644 --- a/test/replication/election_qsync_stress.result +++ b/test/replication/election_qsync_stress.result @@ -88,8 +88,13 @@ test_run:cmd('setopt delimiter ";"') | ... for i = 1,10 do c:eval('box.cfg{replication_synchro_quorum=4, replication_synchro_timeout=1000}') + lsn = c:eval('return box.info.lsn') c.space.test:insert({i}, {is_async=true}) - test_run:wait_cond(function() return c.space.test:get{i} ~= nil end) + test_run:wait_cond(function() return c:eval('return box.info.lsn') > lsn end) + r1_nr = old_leader_nr % 3 + 1 + r2_nr = (old_leader_nr + 1) % 3 + 1 + test_run:wait_lsn('election_replica'..r1_nr, 'election_replica'..old_leader_nr) + test_run:wait_lsn('election_replica'..r2_nr, 'election_replica'..old_leader_nr) test_run:cmd('stop server '..old_leader) nrs[old_leader_nr] = false new_leader_nr = get_leader(nrs) diff --git a/test/replication/election_qsync_stress.test.lua b/test/replication/election_qsync_stress.test.lua index d70601cc5..5e5905f23 100644 --- a/test/replication/election_qsync_stress.test.lua +++ b/test/replication/election_qsync_stress.test.lua @@ -50,8 +50,13 @@ _ = c:eval('box.space.test:create_index("pk")') test_run:cmd('setopt delimiter ";"') for i = 1,10 do c:eval('box.cfg{replication_synchro_quorum=4, replication_synchro_timeout=1000}') + lsn = c:eval('return box.info.lsn') c.space.test:insert({i}, {is_async=true}) - test_run:wait_cond(function() return c.space.test:get{i} ~= nil end) + test_run:wait_cond(function() return c:eval('return box.info.lsn') > lsn end) + r1_nr = old_leader_nr % 3 + 1 + r2_nr = (old_leader_nr + 1) % 3 + 1 + test_run:wait_lsn('election_replica'..r1_nr, 'election_replica'..old_leader_nr) + test_run:wait_lsn('election_replica'..r2_nr, 'election_replica'..old_leader_nr) test_run:cmd('stop server '..old_leader) nrs[old_leader_nr] = false new_leader_nr = get_leader(nrs) -- 2.24.3 (Apple Git-128)