anchor.diff:            <<_:PrefixLen/binary, VBucketName/binary>> <- [FullName],
             VBucketName =/= <<"master">>]).
   
  -change_vbucket_states_inner(SetName, Active, Passive, MainCleanup,
  -                            Replica0, ReplicaCleanup0,
  -                            PauseVBuckets0, UnpauseVBuckets0,
  -                            State, DDocIds) ->
  -    PausingOn = cluster_compat_mode:is_index_pausing_on(),
  -
  -    PauseVBuckets = case PausingOn of
  -                        true -> PauseVBuckets0;
  -                        _ -> []
  -                    end,
  -    UnpauseVBuckets = case PausingOn of
  -                          true -> UnpauseVBuckets0;
  -                          _ -> []
  -                      end,
  -
  -    UseReplicaIndex = State#state.use_replica_index,
  -    Replica = case UseReplicaIndex of
  -                  true -> Replica0;
  -                  _ ->
  -                      []
  -              end,
  -    ReplicaCleanup = case UseReplicaIndex of
  -                         true -> ReplicaCleanup0;
  -                         _ -> []
  -                     end,
  -
  +do_apply_vbucket_states(SetName, Active, Passive, MainCleanup, Replica, ReplicaCleanup, PauseVBuckets, UnpauseVBuckets, State) ->
  +    DDocIds = get_live_ddoc_ids(State),
       RVs = [{DDocId, (catch begin
                                  apply_index_states(SetName, DDocId,
                                                     Active, Passive, MainCleanup, Replica, ReplicaCleanup,
  
positive.code:                                                      usable_vbuckets = UsableVBuckets,
                                                       rebalance_states = RebalanceStates} = State) ->
      [] = RebalanceStates,
      ?log_info("Deleting vbucket ~p from all indexes (empty wanted_states case)", [VBucket]),
      SetName = list_to_binary(Bucket),
      apply_one_off_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,
  
negative.code:         true ->
              {reply, ok, State};
          false ->
              change_vbucket_states(State2),
              {reply, ok, State2}
      end;
  
  