@@ -76,14 +76,11 @@ local function tnt_cluster_prepare(cfg_args)
76
76
cfg_args [snapdir_optname ()] = dir
77
77
cfg_args [logger_optname ()] = fio .pathjoin (dir , ' tarantool.log' )
78
78
cfg_args [' listen' ] = bind_master
79
- cfg_args [' replication' ] = {' replicator:password@' .. bind_replica ,
80
- ' replicator:password@' .. bind_master }
79
+ cfg_args [' replication' ] = {' replicator:password@' .. bind_master }
81
80
if vinyl_name () then
82
81
local vinyl_optname = vinyl_name () .. ' _dir'
83
82
cfg_args [vinyl_optname ] = dir
84
83
end
85
- cfg_args [' replication_connect_quorum' ] = 1
86
- cfg_args [' replication_connect_timeout' ] = 0.01
87
84
88
85
box .cfg (cfg_args )
89
86
-- Allow guest all operations.
@@ -123,14 +120,27 @@ local function tnt_cluster_prepare(cfg_args)
123
120
stderr = ' devnull' ,
124
121
})
125
122
126
- -- Wait for replica to connect.
127
- local id = (box .info .replication [1 ].uuid ~= box .info .uuid and 1 ) or 2
128
123
local attempts = 0
129
124
130
- while true do
131
- if # box .info .replication == 2 and box .info .replication [id ].upstream then
132
- break
125
+ -- Wait for replica to connect.
126
+ while box .info .replication [2 ] == nil or box .info .replication [2 ].downstream .status ~= ' follow' do
127
+ attempts = attempts + 1
128
+ if attempts == 30 then
129
+ error (' wait for replica connection' )
133
130
end
131
+ fiber .sleep (0.1 )
132
+ end
133
+
134
+ box .cfg ({replication =
135
+ {' replicator:password@' .. bind_replica ,
136
+ ' replicator:password@' .. bind_master
137
+ }
138
+ })
139
+
140
+ -- Wait for connect to replica.
141
+ attempts = 0
142
+
143
+ while box .info .replication [2 ].upstream .status ~= ' follow' do
134
144
attempts = attempts + 1
135
145
if attempts == 30 then
136
146
error (' wait for replica failed' )
0 commit comments