Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko <sergepetrenko@tarantool.org>
To: v.shpilevoy@tarantool.org, gorcunov@gmail.com
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH v2 5/6] test: fix replication/election_qsync_stress test
Date: Wed, 23 Dec 2020 14:59:23 +0300	[thread overview]
Message-ID: <a39a1e68c536e2d4f0477c81029530ba5fa70068.1608724239.git.sergepetrenko@tarantool.org> (raw)
In-Reply-To: <cover.1608724238.git.sergepetrenko@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)

  parent reply	other threads:[~2020-12-23 11:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 11:59 [Tarantool-patches] [PATCH v2 0/6] make clear_synchro_queue commit everything Serge Petrenko
2020-12-23 11:59 ` [Tarantool-patches] [PATCH v2 1/6] box: add a single execution guard to clear_synchro_queue Serge Petrenko
2020-12-23 11:59 ` [Tarantool-patches] [PATCH v2 2/6] relay: introduce on_status_update trigger Serge Petrenko
2020-12-23 17:25   ` Vladislav Shpilevoy
2020-12-24 16:11     ` Serge Petrenko
2020-12-23 11:59 ` [Tarantool-patches] [PATCH v2 3/6] txn_limbo: introduce txn_limbo_last_synchro_entry method Serge Petrenko
2020-12-23 17:25   ` Vladislav Shpilevoy
2020-12-24 16:13     ` Serge Petrenko
2020-12-23 11:59 ` [Tarantool-patches] [PATCH v2 4/6] box: rework clear_synchro_queue to commit everything Serge Petrenko
2020-12-23 17:28   ` Vladislav Shpilevoy
2020-12-24 16:12     ` Serge Petrenko
2020-12-24 17:35       ` Vladislav Shpilevoy
2020-12-24 21:02         ` Serge Petrenko
2020-12-23 11:59 ` Serge Petrenko [this message]
2020-12-23 11:59 ` [Tarantool-patches] [PATCH v2 6/6] txn_limbo: ignore CONFIRM/ROLLBACK for a foreign master Serge Petrenko
2020-12-23 17:28   ` Vladislav Shpilevoy
2020-12-24 16:13     ` Serge Petrenko
2020-12-25 10:04 ` [Tarantool-patches] [PATCH v2 0/6] make clear_synchro_queue commit everything Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a39a1e68c536e2d4f0477c81029530ba5fa70068.1608724239.git.sergepetrenko@tarantool.org \
    --to=sergepetrenko@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 5/6] test: fix replication/election_qsync_stress test' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox