anchor.diff:      end.
   
   split_partitions(Partitions,
  -                 #state{repl_type = both, remaining_tap_partitions = TapPartitions}) ->
  +                 #state{repl_type = {upr, TapPartitions}}) ->
       {ordsets:intersection(Partitions, TapPartitions),
        ordsets:subtract(Partitions, TapPartitions)}.
   
  
positive.code:                             end, CurrentReps),
      {reply, upr_replicator:takeover(OldMasterNode, Bucket, VBucket),
       State#state{desired_replications = DesiredReps}}.
  
  do_set_replication_type(Type, TapPartitions,
                          #state{repl_type = Type, remaining_tap_partitions = TapPartitions}
                          = State) ->
      {reply, ok, State};
  do_set_replication_type(Type, TapPartitions,
                          #state{repl_type = OldType,
                                 remaining_tap_partitions = OldTapPartitions,
                                 desired_replications = DesiredReplications} = State) ->
      ?log_debug("Change replication type from ~p to ~p", [{OldType, OldTapPartitions},
                                                           {Type, TapPartitions}]),
  
      State1 =
          case DesiredReplications of
              [] ->
                  State;
              _ ->
                  CleanedReplications =
                      lists:keymap(fun (Partitions) ->
                                           [P || P <- Partitions,
                                                 replication_type(P, Type, TapPartitions) =:=
                                                     replication_type(P, OldType, OldTapPartitions)]
                                   end, 2, DesiredReplications),
  
                  {reply, ok, S} =
                      handle_call({set_desired_replications, CleanedReplications}, [], State),
                  S
          end,
      {reply, ok, State1#state{repl_type = Type,
                               remaining_tap_partitions = TapPartitions}}.
  
  manage_tap_replication_manager(Bucket, Type, TapReplManager) ->
      case {Type, TapReplManager} of
  
negative.code: handle_info(_Msg, State) ->
      {noreply, State}.
  
  handle_call(get_incoming_replication_map, _From, #state{repl_type = ReplType,
                                                          bucket_name = Bucket} = State) ->
      {reply, get_actual_replications(Bucket, ReplType), State};
  handle_call({remove_undesired_replications, FutureReps}, From,
              #state{desired_replications = CurrentReps} = State) ->
      Diff = replications_difference(FutureReps, CurrentReps),
  