anchor.diff:  query_states(Bucket, Nodes, undefined) ->
       query_states(Bucket, Nodes, ?WAIT_FOR_MEMCACHED_TIMEOUT);
   query_states(Bucket, Nodes, ReadynessWaitTimeout) ->
  +    {ok, States, Failures} = query_states_details(Bucket, Nodes, ReadynessWaitTimeout),
  +    BadNodes = [N || {N, _} <- Failures],
  +    {ok, States, BadNodes}.
  +
  +-spec query_states_details(bucket_name(), [node()], undefined | pos_integer()) ->
  +                                  {ok, [{node(), vbucket_id(), vbucket_state()}],
  +                                   [{node(), term()}]}.
  +query_states_details(Bucket, Nodes, undefined) ->
  +    query_states_details(Bucket, Nodes, ?WAIT_FOR_MEMCACHED_TIMEOUT);
  +query_states_details(Bucket, Nodes, ReadynessWaitTimeout) ->
       NodeRVs = wait_for_memcached(Nodes, Bucket, ReadynessWaitTimeout),
       Failures = [{N, R} || {N, R} <- NodeRVs,
                             case R of
  
positive.code:                                            erlang:unlink(Me)
                                     end)}
                            || Node <- Nodes],
                [receive
                     {'EXIT', Parent, Reason} ->
                         ?log_debug("Parent died ~p", [Reason]),
                         exit(Reason);
                     {'EXIT', P, Reason} = ExitMsg ->
                         case Reason of
                             {Ref, RV} ->
                                 {Node, RV};
                             killed ->
                                 {Node, ExitMsg};
                             _ ->
                                 ?log_info("Got exception trying to query vbuckets of ~p bucket ~p~n~p", [Node, Bucket, Reason]),
                                 {Node, ExitMsg}
                         end
                 end || {Node, P} <- NodePids]
        end).
  
  
  complete_flush(Bucket, Nodes, Timeout) ->
      {Replies, BadNodes} = gen_server:multi_call(Nodes, server_name(Bucket), complete_flush, Timeout),
  
negative.code:               NodePids = [{Node, proc_lib:spawn_link(
                                     fun () ->
                                             {ok, TRef} = timer2:kill_after(WaitTimeout),
                                             RV = query_vbucket_states_loop(Node, Bucket, Me),
                                             Me ! {'EXIT', self(), {Ref, RV}},
                                             %% doing cancel is quite
                                             %% important. kill_after is
  