Skip to content

Commit

Permalink
ci: remove deprecated option from utils
Browse files Browse the repository at this point in the history
Deprecated `replication_connect_quorum` option was removed
from replicaset setup method.
  • Loading branch information
0x501D authored and LeonidVas committed Sep 7, 2023
1 parent 821f9aa commit 03177cc
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions t/tnt/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,11 @@ local function tnt_cluster_prepare(cfg_args)
cfg_args[snapdir_optname()] = dir
cfg_args[logger_optname()] = fio.pathjoin(dir, 'tarantool.log')
cfg_args['listen'] = bind_master
cfg_args['replication'] = {'replicator:password@' .. bind_replica,
'replicator:password@' .. bind_master}
cfg_args['replication'] = {'replicator:password@' .. bind_master}
if vinyl_name() then
local vinyl_optname = vinyl_name() .. '_dir'
cfg_args[vinyl_optname] = dir
end
cfg_args['replication_connect_quorum'] = 1
cfg_args['replication_connect_timeout'] = 0.01

box.cfg(cfg_args)
-- Allow guest all operations.
Expand Down Expand Up @@ -123,14 +120,27 @@ local function tnt_cluster_prepare(cfg_args)
stderr = 'devnull',
})

-- Wait for replica to connect.
local id = (box.info.replication[1].uuid ~= box.info.uuid and 1) or 2
local attempts = 0

while true do
if #box.info.replication == 2 and box.info.replication[id].upstream then
break
-- Wait for replica to connect.
while box.info.replication[2] == nil or box.info.replication[2].downstream.status ~= 'follow' do
attempts = attempts + 1
if attempts == 30 then
error('wait for replica connection')
end
fiber.sleep(0.1)
end

box.cfg({replication =
{'replicator:password@' .. bind_replica,
'replicator:password@' .. bind_master
}
})

-- Wait for connect to replica.
attempts = 0

while box.info.replication[2].upstream.status ~= 'follow' do
attempts = attempts + 1
if attempts == 30 then
error('wait for replica failed')
Expand Down

0 comments on commit 03177cc

Please sign in to comment.