Skip to content

Commit 8928998

Browse files
committed
Setup replication_sync_timeout at .tarantoolctl
Found that tests may fail due to hang in seek_wait() loop on starting and stopping instances. It happened, because instances were not synced within default output timeout which is by default 120 seconds, while replication sync happens only each 300 seconds by default. To fix it replication_sync_timeout should be decreased to some value lower than 'no-output-timeout', so decided to set it to 100 seconds. The issue looked like in tests: --- replication/gh-5140-qsync-casc-rollback.result Mon Oct 19 17:29:46 2020 +++ /rw_bins/test/var/070_replication/gh-5140-qsync-casc-rollback.result Mon Oct 19 17:31:35 2020 @@ -169,56 +169,3 @@ -- all the records are replayed one be one without yields for WAL writes, and -- nothing should change. test_run:cmd('restart server default') - | -test_run:cmd('restart server replica') - | --- - | - true - | ... - Part of tarantool/tarantool#5504
1 parent a5a37ee commit 8928998

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

.tarantoolctl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
-- Options for test-run tarantoolctl
22

33
local workdir = os.getenv('TEST_WORKDIR')
4+
local repl_sync_timeout = tonumber(os.getenv('REPLICATION_SYNC_TIMEOUT'))
45
default_cfg = {
56
pid_file = workdir,
67
wal_dir = workdir,
78
memtx_dir = workdir,
89
vinyl_dir = workdir,
910
log = workdir,
1011
background = false,
12+
replication_sync_timeout = repl_sync_timeout,
1113
}
1214

1315
instance_dir = workdir

lib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def module_init():
5252
soext = sys.platform == 'darwin' and 'dylib' or 'so'
5353
os.environ["LUA_PATH"] = SOURCEDIR+"/?.lua;"+SOURCEDIR+"/?/init.lua;;"
5454
os.environ["LUA_CPATH"] = BUILDDIR+"/?."+soext+";;"
55+
os.environ["REPLICATION_SYNC_TIMEOUT"] = str(args.replication_sync_timeout)
5556

5657
TarantoolServer.find_exe(args.builddir)
5758
UnittestServer.find_exe(args.builddir)

lib/options.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,20 @@ def __init__(self):
201201
--valgrind, --long options is passed).
202202
Note: The option works now only with parallel testing.""")
203203

204+
parser.add_argument(
205+
"--replication-sync-timeout",
206+
dest="replication_sync_timeout",
207+
default=100,
208+
type=int,
209+
help="""The number of seconds that a replica will wait when
210+
trying to sync with a master in a cluster, or a quorum of
211+
masters, after connecting or during configuration update.
212+
This could fail indefinitely if replication_sync_lag is smaller
213+
than network latency, or if the replica cannot keep pace with
214+
master updates. If replication_sync_timeout expires, the replica
215+
enters orphan status.
216+
Default: 100 [seconds].""")
217+
204218
parser.add_argument(
205219
"--luacov",
206220
dest="luacov",

lib/tarantool_server.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,11 @@ def copy_files(self):
772772
if (e.errno == errno.ENOENT):
773773
continue
774774
raise
775+
# Previously tarantoolctl configuration file located in tarantool
776+
# repository at test/ directory. Currently it is located in root
777+
# path of test-run/ submodule repository. For backward compatibility
778+
# this file should be checked at the old place and only after at
779+
# the current.
775780
tntctl_file = '.tarantoolctl'
776781
if not os.path.exists(tntctl_file):
777782
tntctl_file = os.path.join(self.TEST_RUN_DIR, '.tarantoolctl')

0 commit comments

Comments
 (0)