anchor.diff:                                use_replica_index=UseReplicaIndex},
   
       try
  -        ok = ?csv_call(define_group, [SetName, DDocId, Params])
  +        ok = csv_call(define_group, [SetName, DDocId, Params])
       catch
           throw:{not_found, deleted} ->
               %% The document has been deleted but we still think it's
  
positive.code:           <<_:PrefixLen/binary, VBucketName/binary>> <- [FullName],
            VBucketName =/= <<"master">>]).
  
  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,
  
negative.code: 
  apply_index_states(SetName, DDocId, Active, Passive, Cleanup,
                     Replica, ReplicaCleanup, PauseVBuckets, UnpauseVBuckets,
                     State, PastException) ->
  
      try
          case UnpauseVBuckets of
              [] ->
                  ok;
              _ ->
                  ok = csv_call(mark_partitions_indexable,
                                [SetName, DDocId, UnpauseVBuckets])
          end,
  
          %% this should go first because some of the replica vbuckets might
          %% need to be cleaned up from main index
          case Active =/= [] orelse Passive =/= [] orelse Cleanup =/= [] of
              true->
                  ok = csv_call(set_partition_states,
                                [SetName, DDocId, Active, Passive, Cleanup]);
              _ -> ok
          end,
  
          case Replica of
              [] -> ok;
              _ ->
                  ok = csv_call(add_replica_partitions,
                                [SetName, DDocId, Replica])
          end,
          case ReplicaCleanup of
              [] -> ok;
              _ ->
                  ok = csv_call(remove_replica_partitions,
                                [SetName, DDocId, ReplicaCleanup])
          end,
  
          case PauseVBuckets of
              [] -> ok;
              _ ->
                  ok = csv_call(mark_partitions_unindexable,
                                [SetName, DDocId, PauseVBuckets])
          end
  
      catch
          throw:{not_found, deleted} = E ->
              %% The document has been deleted but we still think it's
              %% alive. Eventually we will get a notification from master db
              %% watcher and delete it from a list of design documents.
              Stack = erlang:get_stacktrace(),
              erlang:raise(throw, E, Stack);
          T:E ->
              Stack = erlang:get_stacktrace(),
              Exc = [T, E, Stack],
  