@@ -226,6 +226,8 @@ get_fs_coord_status_item(Node, SinkName, ItemName) ->
226226 ClusterProps = proplists :get_value (SinkName , FS_CoordProps ),
227227 proplists :get_value (ItemName , ClusterProps ).
228228
229+
230+
229231start_and_wait_until_fullsync_complete (Node ) ->
230232 start_and_wait_until_fullsync_complete (Node , undefined ).
231233
@@ -235,7 +237,9 @@ start_and_wait_until_fullsync_complete(Node, Cluster) ->
235237start_and_wait_until_fullsync_complete (Node , Cluster , NotifyPid ) ->
236238 start_and_wait_until_fullsync_complete (Node , Cluster , NotifyPid , 20 ).
237239
238- start_and_wait_until_fullsync_complete (Node , Cluster , NotifyPid , Retries ) ->
240+ start_and_wait_until_fullsync_complete (Node , Cluster , NotifyPid , Retries ) when is_atom (Node ) ->
241+ start_and_wait_until_fullsync_complete ([Node ], Cluster , NotifyPid , Retries );
242+ start_and_wait_until_fullsync_complete ([Node |_ ] = Nodes , Cluster , NotifyPid , Retries ) ->
239243 Status0 = rpc :call (Node , riak_repl_console , status , [quiet ]),
240244 Count0 = proplists :get_value (server_fullsyncs , Status0 ),
241245 Count = fullsync_count (Count0 , Status0 , Cluster ),
@@ -252,7 +256,7 @@ start_and_wait_until_fullsync_complete(Node, Cluster, NotifyPid, Retries) ->
252256 % % Send message to process and notify fullsync has began.
253257 fullsync_notify (NotifyPid ),
254258
255- case rt :wait_until (make_fullsync_wait_fun (Node , Count ), 100 , 1000 ) of
259+ case rt :wait_until (make_fullsync_wait_fun (Nodes , Count ), 100 , 1000 ) of
256260 ok ->
257261 ok ;
258262 _ when Retries > 0 ->
@@ -281,19 +285,24 @@ fullsync_notify(NotifyPid) when is_pid(NotifyPid) ->
281285fullsync_notify (_ ) ->
282286 ok .
283287
284- make_fullsync_wait_fun (Node , Count ) ->
288+ make_fullsync_wait_fun (Cluster , Count ) when is_list ( Cluster ) ->
285289 fun () ->
286- Status = rpc :call (Node , riak_repl_console , status , [quiet ]),
287- case Status of
288- {badrpc , _ } ->
289- false ;
290+ make_fullsync_wait_fun2 (Cluster , Count )
291+ end .
292+
293+ make_fullsync_wait_fun2 ([], _ ) ->
294+ false ;
295+ make_fullsync_wait_fun2 ([Node |Tail ], Count ) when is_atom (Node ) ->
296+ Status = rpc :call (Node , riak_repl_console , status , [quiet ]),
297+ case Status of
298+ {badrpc , _ } ->
299+ false ;
300+ _ ->
301+ case proplists :get_value (server_fullsyncs , Status ) of
302+ C when C >= Count ->
303+ true ;
290304 _ ->
291- case proplists :get_value (server_fullsyncs , Status ) of
292- C when C >= Count ->
293- true ;
294- _ ->
295- false
296- end
305+ make_fullsync_wait_fun2 (Tail , Count )
297306 end
298307 end .
299308
0 commit comments