Tarantool development patches archive
 help / color / mirror / Atom feed
From: "Alexander V. Tikhonov" <avtikhon@tarantool.org>
To: Kirill Yukhin <kyukhin@tarantool.org>,
	Serge Petrenko <sergepetrenko@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH v1] test: flaky replication/gh-4606-admin-creds test
Date: Sun,  6 Sep 2020 21:30:48 +0300	[thread overview]
Message-ID: <8128e93e56c1a4b9f1289fb0a5d6396bb47eb8e5.1599416974.git.avtikhon@tarantool.org> (raw)

On heavy loaded hosts found the following issue:

  [021] --- replication/gh-4606-admin-creds.result	Wed Apr 15 15:47:41 2020
  [021] +++ replication/gh-4606-admin-creds.reject	Sun Sep  6 20:23:09 2020
  [021] @@ -36,7 +36,42 @@
  [021]   | ...
  [021]  i.replication[i.id % 2 + 1].upstream.status == 'follow' or i
  [021]   | ---
  [021] - | - true
  [021] + | - version: 2.6.0-52-g71a24b9f2
  [021] + |   id: 2
  [021] + |   ro: false
  [021] + |   uuid: 3921679b-d994-4cf0-a6ef-1f6a0d96fc79
  [021] + |   package: Tarantool
  [021] + |   cluster:
  [021] + |     uuid: f27dfdfe-2802-486a-bc47-abc83b9097cf
  [021] + |   listen: unix/:/Users/tntmac02.tarantool.i/tnt/test/var/014_replication/replica_auth.socket-iproto
  [021] + |   replication_anon:
  [021] + |     count: 0
  [021] + |   replication:
  [021] + |     1:
  [021] + |       id: 1
  [021] + |       uuid: a07cad18-d27f-48c4-8d56-96b17026702e
  [021] + |       lsn: 3
  [021] + |       upstream:
  [021] + |         peer: admin@unix/:/Users/tntmac02.tarantool.i/tnt/test/var/014_replication/master.socket-iproto
  [021] + |         lag: 0.0030207633972168
  [021] + |         status: disconnected
  [021] + |         idle: 0.44824500009418
  [021] + |         message: timed out
  [021] + |         system_message: Operation timed out
  [021] + |     2:
  [021] + |       id: 2
  [021] + |       uuid: 3921679b-d994-4cf0-a6ef-1f6a0d96fc79
  [021] + |       lsn: 0
  [021] + |   signature: 3
  [021] + |   status: running
  [021] + |   vclock: {1: 3}
  [021] + |   uptime: 1
  [021] + |   lsn: 0
  [021] + |   sql: []
  [021] + |   gc: []
  [021] + |   vinyl: []
  [021] + |   memory: []
  [021] + |   pid: 40326
  [021]   | ...
  [021]  test_run:switch('default')
  [021]   | ---

It happened because replication upstream status check occurred too
early, when it was only in 'disconnected' state. To give the
replication status check routine ability to reach the needed 'follow'
state, it need to wait for it using test_run:wait_upstream() routine.

Closes #5233
---

Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-5233-fix-4606
Issue: https://github.com/tarantool/tarantool/issues/5233

 test/replication/gh-4606-admin-creds.result   | 6 +++++-
 test/replication/gh-4606-admin-creds.test.lua | 4 +++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/test/replication/gh-4606-admin-creds.result b/test/replication/gh-4606-admin-creds.result
index fc0fbff44..138e27dce 100644
--- a/test/replication/gh-4606-admin-creds.result
+++ b/test/replication/gh-4606-admin-creds.result
@@ -34,10 +34,14 @@ test_run:switch('replica_auth')
 i = box.info
  | ---
  | ...
-i.replication[i.id % 2 + 1].upstream.status == 'follow' or i
+replica_id = i.id % 2 + 1
+ | ---
+ | ...
+test_run:wait_upstream(replica_id, {status = 'follow'}) or i
  | ---
  | - true
  | ...
+
 test_run:switch('default')
  | ---
  | - true
diff --git a/test/replication/gh-4606-admin-creds.test.lua b/test/replication/gh-4606-admin-creds.test.lua
index 217d46ce1..9ab74700a 100644
--- a/test/replication/gh-4606-admin-creds.test.lua
+++ b/test/replication/gh-4606-admin-creds.test.lua
@@ -16,7 +16,9 @@ test_run:cmd("create server replica_auth with rpl_master=default, script='replic
 test_run:cmd("start server replica_auth with args='admin:111 0.1'")
 test_run:switch('replica_auth')
 i = box.info
-i.replication[i.id % 2 + 1].upstream.status == 'follow' or i
+replica_id = i.id % 2 + 1
+test_run:wait_upstream(replica_id, {status = 'follow'}) or i
+
 test_run:switch('default')
 test_run:cmd("stop server replica_auth")
 test_run:cmd("cleanup server replica_auth")
-- 
2.17.1

             reply	other threads:[~2020-09-06 18:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-06 18:30 Alexander V. Tikhonov [this message]
2020-09-09 15:38 ` Serge Petrenko
2020-09-11 10:35 ` 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=8128e93e56c1a4b9f1289fb0a5d6396bb47eb8e5.1599416974.git.avtikhon@tarantool.org \
    --to=avtikhon@tarantool.org \
    --cc=kyukhin@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v1] test: flaky replication/gh-4606-admin-creds 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