Skip to content

Commit e843552

Browse files
avtikhonTotktonada
authored andcommitted
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 3110939 commit e843552

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

.tarantoolctl

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

3+
-- Note: tonumber(nil) is nil.
34
local workdir = os.getenv('TEST_WORKDIR')
5+
local replication_sync_timeout = tonumber(os.getenv('REPLICATION_SYNC_TIMEOUT'))
6+
47
default_cfg = {
58
pid_file = workdir,
69
wal_dir = workdir,
710
memtx_dir = workdir,
811
vinyl_dir = workdir,
912
log = workdir,
1013
background = false,
14+
replication_sync_timeout = replication_sync_timeout,
1115
}
1216

1317
instance_dir = workdir

lib/__init__.py

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

6162
TarantoolServer.find_exe(args.builddir)
6263
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",

0 commit comments

Comments
 (0)