anchor.diff:  
   handle_call({delete_vbucket, VBucket}, _From, #state{bucket = Bucket,
                                                        wanted_states = [],
  -                                                     rebalance_states = RebalanceStates,
  -                                                     use_replica_index = UseReplicaIndex} = State) ->
  +                                                     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], [], [], UseReplicaIndex),
  +    do_apply_vbucket_states(SetName, [], [], [VBucket], [], [VBucket], [], [], State),
       {reply, ok, State};
   handle_call({delete_vbucket, VBucket}, _From, #state{usable_vbuckets = UsableVBuckets,
                                                        wanted_states = WantedStates,
  
positive.code: change_vbucket_states(#state{bucket = Bucket,
                               wanted_states = WantedStates,
                               rebalance_states = RebalanceStates,
                               use_replica_index = UseReplicaIndex,
                               usable_vbuckets = UsableVBuckets} = _State) ->
      apply_vbucket_states(Bucket, WantedStates, RebalanceStates, UseReplicaIndex, UsableVBuckets).
  
  start_link(Bucket) ->
      {ok, BucketConfig} = ns_bucket:get_bucket(Bucket),
  
negative.code:           VBucketName <- [binary:part(FullName, PrefixLen, erlang:size(FullName) - PrefixLen)],
            VBucketName =/= <<"master">>]).
  
  do_apply_vbucket_states(SetName, Active, Passive, MainCleanup, Replica, ReplicaCleanup, PauseVBuckets, UnpauseVBuckets, State) ->
      RVs = capi_ddoc_replication_srv:foreach_live_ddoc_id(
              SetName,
              fun (DDocId) ->
                      apply_index_states(SetName, DDocId,
                                         Active, Passive, MainCleanup, Replica, ReplicaCleanup,
                                         PauseVBuckets, UnpauseVBuckets,
                                         State),
                      ok
              end),
      BadDDocs = [Pair || {_Id, Val} = Pair <- RVs,
  