anchor.diff:      lists:keyreplace(Repair#repair.mod_partition, #repair.mod_partition,
                        Repairs, Repair).
   
  +%% @private
  +%%
  +%% @doc Get the `{Partition, Owner}' pair that comes before the
  +%%      partition under repair.
  +-spec get_minus_one([{index(), node()}]) -> {index(), node()}.
  +get_minus_one([MinusOne, _, _]) ->
  +    MinusOne.
  +
  +%% @private
  +%%
  +%% @doc Get the `{Partition, Owner}' pair that comes after the
  +%%      partition under repair.
  +-spec get_plus_one([{index(), node()}]) -> {index(), node()}.
  +get_plus_one([_, _, PlusOne]) ->
  +    PlusOne.
  +
   %% TODO: Need to kill the receivers for these xfers in case the cast
   %% doesn't reach the handoff mgr.
   kill_repairs(Repairs, Reason) ->
       Kill =
           fun(R) ->
  -                {_,MOOwner} = R#repair.minus_one,
  -                {_,POOwner} = R#repair.plus_one,
  +                {_,MOOwner} = get_minus_one(R),
  +                {_,POOwner} = get_minus_one(R),
                   MOX = R#repair.minus_one_xfer,
                   POX = R#repair.plus_one_xfer,
                   MOModSrcTarget = MOX#xfer_status.mod_src_target,
  
positive.code: repair(Service, {_Module, Partition}=ModPartition, FilterModFun) ->
      %% Fwd the request to the partition owner to guarantee that there
      %% is only one request per partition.
      %%
      %% TODO: Pass Ring (or piece of info) to verify receiving nodes
      %% have same ring or abort repair.
      {ok, Ring} = riak_core_ring_manager:get_my_ring(),
      Pairs = [_, {_, Owner}, _] = repair_pairs(Ring, Partition),
      UpNodes = riak_core_node_watcher:nodes(Service),
      case riak_core_ring:pending_changes(Ring) of
          [] ->
              case check_up(Pairs, UpNodes) of
                  true ->
                      Msg = {repair, ModPartition, Pairs, FilterModFun},
                      ok = gen_server:call({?MODULE, Owner}, Msg),
                      {ok, Pairs};
                  {false, Down} ->
                      {down, Down}
              end;
          _ ->
              ownership_change_in_progress
      end.
  
  %% @doc Get the status of the repair process for a given `ModPartition'.
  -spec repair_status(mod_partition()) -> in_progress | not_found.
  
negative.code:         {
            mod_partition         :: mod_partition(),
            filter_mod_fun        :: {module(), atom()},
            minus_one_xfer        :: xfer_status(),
            plus_one_xfer         :: xfer_status(),
            pairs                 :: [{index(), node()}]
          }).
  -type repair() :: #repair{}.
  -type repairs() :: [repair()].
  