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:                     erlang:raise(T, E, Stack)
              end
      end.
  
  mk_mc_couch_event_handler(Bucket) ->
      Self = self(),
  
      fun (Event, _) ->
              handle_mc_couch_event(Self, Bucket, Event)
      end.
  
  handle_mc_couch_event(Self, Bucket,
                        {set_vbucket, Bucket, VBucket, State, Checkpoint}) ->
      ?views_debug("Got set_vbucket event for ~s/~b. Updated state: ~p (~B)",
                   [Bucket, VBucket, State, Checkpoint]),
      Self ! refresh_usable_vbuckets;
  handle_mc_couch_event(_, _, _) ->
      ok.
  
  replicate_newnodes_docs(State) ->
      #state{bucket=Bucket,
  
negative.code: 
  change_vbucket_states(#state{bucket = Bucket,
                               wanted_states = WantedStates,
                               rebalance_states = RebalanceStates} = State) ->
      SetName = list_to_binary(Bucket),
      {Active, Passive, MainCleanup, Replica, ReplicaCleanup, PauseVBuckets, UnpauseVBuckets} =
          compute_index_states(WantedStates, RebalanceStates),
      do_apply_vbucket_states(SetName, Active, Passive, MainCleanup, Replica, ReplicaCleanup, PauseVBuckets, UnpauseVBuckets, State).
  
  start_link(Bucket) ->
  