anchor.diff:                  use_replica_index :: boolean(),
                   master_db_watcher :: pid(),
                   wanted_states :: [missing | active | replica],
  -                rebalance_states :: [rebalance_vbucket_state()],
  -                usable_vbuckets}).
  +                rebalance_states :: [rebalance_vbucket_state()]}).
   
   set_vbucket_states(Bucket, WantedStates, RebalanceStates) ->
       gen_server:call(server(Bucket), {set_vbucket_states, WantedStates, RebalanceStates}, infinity).
  
positive.code: 
  handle_call({delete_vbucket, VBucket}, _From, #state{bucket = Bucket,
                                                       wanted_states = [],
                                                       usable_vbuckets = UsableVBuckets,
                                                       rebalance_states = RebalanceStates} = State) ->
      [] = RebalanceStates,
      ?log_info("Deleting vbucket ~p from all indexes", [VBucket]),
      SetName = list_to_binary(Bucket),
      do_apply_vbucket_states(SetName, [], [], [VBucket], [], [VBucket], [], [], State),
      {reply, ok, State#state{usable_vbuckets = sets:del_element(VBucket, UsableVBuckets)}};
  handle_call({delete_vbucket, VBucket}, _From, #state{usable_vbuckets = UsableVBuckets,
                                                       wanted_states = WantedStates,
                                                       rebalance_states = RebalanceStates} = State) ->
      NewUsableVBuckets = sets:del_element(VBucket, UsableVBuckets),
      case NewUsableVBuckets =:= UsableVBuckets of
          true ->
              {reply, ok, State};
          _ ->
              NewState = State#state{usable_vbuckets = NewUsableVBuckets},
              case (lists:nth(VBucket+1, WantedStates) =:= missing
                    andalso lists:nth(VBucket+1, RebalanceStates) =:= undefined) of
                  true ->
                      %% skipping vbucket changes pass iff it's totally
                      %% uninteresting vbucket
                      ok;
                  false ->
                      change_vbucket_states(NewState)
              end,
              {reply, ok, NewState}
      end;
  handle_call(reset_master_vbucket, _From, #state{bucket = Bucket,
  
negative.code:     [{ServerName, N} ! replicate_newnodes_docs ||
          N <- get_remote_nodes(Bucket)],
  
      State = #state{bucket=Bucket,
                     proxy_server_name = ServerName,
                     local_docs = Docs,
                     num_vbuckets = NumVBuckets,
                     use_replica_index=UseReplicaIndex,
                     wanted_states = [],
                     rebalance_states = []},
  
      proc_lib:init_ack({ok, self()}),
  
  