Tarantool development patches archive
 help / color / mirror / Atom feed
From: "Alexander V. Tikhonov" <avtikhon@tarantool.org>
To: Kirill Yukhin <kyukhin@tarantool.org>,
	Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH v2] test: flaky replication/gh-5195-qsync-*
Date: Thu, 10 Sep 2020 11:19:44 +0300	[thread overview]
Message-ID: <3c7bf567754b36d886ba6357691acd9b4c4c9165.1599725831.git.avtikhon@tarantool.org> (raw)

On heavy loaded hosts found the following issue:

   box.cfg{replication_synchro_quorum = 2}
    | ---
  + | - error: '[string "test_run:wait_cond(function()                ..."]:1: attempt to
  + |     index field ''vclock'' (a nil value)'
    | ...

The issue output was not correct due to wrong output list. Real command
that caused the initial issue was the previous command:

  test_run:wait_cond(function()                                                   \
          local info = box.info.replication[replica_id]                           \
          local lsn = info.downstream.vclock[replica_id]                          \
          return lsn and lsn >= replica_lsn                                       \
  end)

It happened because replication vclock field was not exist at the moment
of its check. To fix the issue, vclock field had to be waited to be
available using test_run:wait_cond() routine.

Closes #5230
---

Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-5230-fix-qsync-write-5195
Issue: https://github.com/tarantool/tarantool/issues/5230

 test/replication/gh-5195-qsync-replica-write.result   | 11 +++++++----
 test/replication/gh-5195-qsync-replica-write.test.lua |  8 ++++----
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/test/replication/gh-5195-qsync-replica-write.result b/test/replication/gh-5195-qsync-replica-write.result
index 3999e8f5e..906f4910d 100644
--- a/test/replication/gh-5195-qsync-replica-write.result
+++ b/test/replication/gh-5195-qsync-replica-write.result
@@ -96,10 +96,13 @@ test_run:wait_downstream(replica_id, {status='follow'})
  | - true
  | ...
 test_run:wait_cond(function()                                                   \
-        local info = box.info.replication[replica_id]                           \
-        local lsn = info.downstream.vclock[replica_id]                          \
-        return lsn and lsn >= replica_lsn                                       \
-end)                                                                            \
+        local vclock = box.info.replication[replica_id].downstream.vclock       \
+        return (vclock and vclock[replica_id] and                               \
+                vclock[replica_id] >= replica_lsn)                              \
+    end) or box.info
+ | ---
+ | - true
+ | ...
 
 box.cfg{replication_synchro_quorum = 2}
  | ---
diff --git a/test/replication/gh-5195-qsync-replica-write.test.lua b/test/replication/gh-5195-qsync-replica-write.test.lua
index 2b9909e21..d7d09fa35 100644
--- a/test/replication/gh-5195-qsync-replica-write.test.lua
+++ b/test/replication/gh-5195-qsync-replica-write.test.lua
@@ -41,10 +41,10 @@ replica_id = test_run:get_server_id('replica')
 replica_lsn = test_run:get_lsn('replica', replica_id)
 test_run:wait_downstream(replica_id, {status='follow'})
 test_run:wait_cond(function()                                                   \
-        local info = box.info.replication[replica_id]                           \
-        local lsn = info.downstream.vclock[replica_id]                          \
-        return lsn and lsn >= replica_lsn                                       \
-end)                                                                            \
+        local vclock = box.info.replication[replica_id].downstream.vclock       \
+        return (vclock and vclock[replica_id] and                               \
+                vclock[replica_id] >= replica_lsn)                              \
+    end) or box.info
 
 box.cfg{replication_synchro_quorum = 2}
 test_run:wait_cond(function() return f:status() == 'dead' end)
-- 
2.17.1

             reply	other threads:[~2020-09-10  8:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-10  8:19 Alexander V. Tikhonov [this message]
2020-09-10 19:21 ` Vladislav Shpilevoy

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=3c7bf567754b36d886ba6357691acd9b4c4c9165.1599725831.git.avtikhon@tarantool.org \
    --to=avtikhon@tarantool.org \
    --cc=kyukhin@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2] test: flaky replication/gh-5195-qsync-*' \
    /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