@@ -235,7 +235,9 @@ start_and_wait_until_fullsync_complete(Node, Cluster) ->
235235start_and_wait_until_fullsync_complete (Node , Cluster , NotifyPid ) ->
236236 start_and_wait_until_fullsync_complete (Node , Cluster , NotifyPid , 20 ).
237237
238- start_and_wait_until_fullsync_complete (Node , Cluster , NotifyPid , Retries ) ->
238+ start_and_wait_until_fullsync_complete (Node , Cluster , NotifyPid , Retries ) when is_atom (Node ) ->
239+ start_and_wait_until_fullsync_complete ([Node ], Cluster , NotifyPid , Retries );
240+ start_and_wait_until_fullsync_complete ([Node |_ ] = Nodes , Cluster , NotifyPid , Retries ) ->
239241 Status0 = rpc :call (Node , riak_repl_console , status , [quiet ]),
240242 Count0 = proplists :get_value (server_fullsyncs , Status0 ),
241243 Count = fullsync_count (Count0 , Status0 , Cluster ),
@@ -252,7 +254,7 @@ start_and_wait_until_fullsync_complete(Node, Cluster, NotifyPid, Retries) ->
252254 % % Send message to process and notify fullsync has began.
253255 fullsync_notify (NotifyPid ),
254256
255- case rt :wait_until (make_fullsync_wait_fun (Node , Count ), 100 , 1000 ) of
257+ case rt :wait_until (make_fullsync_wait_fun (Nodes , Count ), 100 , 1000 ) of
256258 ok ->
257259 ok ;
258260 _ when Retries > 0 ->
@@ -281,19 +283,24 @@ fullsync_notify(NotifyPid) when is_pid(NotifyPid) ->
281283fullsync_notify (_ ) ->
282284 ok .
283285
284- make_fullsync_wait_fun (Node , Count ) ->
286+ make_fullsync_wait_fun (Cluster , Count ) when is_list ( Cluster ) ->
285287 fun () ->
286- Status = rpc :call (Node , riak_repl_console , status , [quiet ]),
287- case Status of
288- {badrpc , _ } ->
289- false ;
288+ make_fullsync_wait_fun2 (Cluster , Count )
289+ end .
290+
291+ make_fullsync_wait_fun2 ([], _ ) ->
292+ false ;
293+ make_fullsync_wait_fun2 ([Node |Tail ], Count ) when is_atom (Node ) ->
294+ Status = rpc :call (Node , riak_repl_console , status , [quiet ]),
295+ case Status of
296+ {badrpc , _ } ->
297+ false ;
298+ _ ->
299+ case proplists :get_value (server_fullsyncs , Status ) of
300+ C when C >= Count ->
301+ true ;
290302 _ ->
291- case proplists :get_value (server_fullsyncs , Status ) of
292- C when C >= Count ->
293- true ;
294- _ ->
295- false
296- end
303+ make_fullsync_wait_fun2 (Tail , Count )
297304 end
298305 end .
299306
0 commit comments