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:                 rebalance_subprocesses_registry :: pid()}).
  
  -export([wait_for_bucket_creation/2, query_states/3,
           apply_new_bucket_config_with_timeout/6,
           mark_bucket_warmed/2,
           delete_vbucket_copies/4,
  
negative.code:                      end],
      BadNodes.
  
  query_vbucket_states_loop(Node, Bucket, Parent) ->
      query_vbucket_states_loop(Node, Bucket, Parent, undefined).
  query_vbucket_states_loop(Node, Bucket, Parent, Warming) ->
      case (catch gen_server:call(server_name(Bucket, Node), query_vbucket_states, infinity)) of
          {ok, _} = Msg ->
              Msg;
          warming_up ->
              query_vbucket_states_loop_next_step(Node, Bucket, Parent,
                                                  Warming, warming_up);
          {'EXIT', {noproc, _}} = Exc ->
              ?log_debug("Exception from query_vbucket_states of ~p:~p~n~p",
                         [Bucket, Node, Exc]),
              query_vbucket_states_loop_next_step(Node, Bucket, Parent,
                                                  Warming, noproc);
          Exc ->
              ?log_debug("Exception from query_vbucket_states of ~p:~p~n~p",
                         [Bucket, Node, Exc]),
              Exc
      end.
  
  query_vbucket_states_loop_next_step(Node, Bucket, Parent, Warming, Reason) ->
      ?log_debug("Waiting for ~p on ~p", [Bucket, Node]),
      NewWarming = maybe_send_warming(Parent, Warming, Reason),
      timer:sleep(1000),
      query_vbucket_states_loop(Node, Bucket, Parent, NewWarming).
  
  maybe_send_warming(Parent, undefined, warming_up) ->
      Parent ! warming_up;
  maybe_send_warming(_Parent, Warming, _Reason) ->
      Warming.
  
  -spec wait_for_memcached([node()], bucket_name(), non_neg_integer()) -> [{node(), {ok, list()} | warming_up | timeout | any()}].
  wait_for_memcached(Nodes, Bucket, WaitTimeout) ->
      Parent = self(),
      misc:executing_on_new_process(
  