Fix dialyzer commands in Makefile
Fix type spec for `status_update`
Add repair ability

Add the framework needed for services on top of core to provide a
"repair" mechanism.  At this point repair was built with the sole
purpose of repairing data for KV and Search.

The key insight behind repair is that since Riak is a replicated data
store one partition can be rebuilt from the replicas on other
partitions.  Specifically, the adjacent (i.e. before and after)
partitions on the ring, together, contain all the replicas that are
stored on the partition to be repaired.  The rub is that adjacent
partitions also contain replicas that are _not_ meant to be on the
partition under repair.  This means a filter function must be used
while folding over the source partitions to transfer only the data
that belongs.  This is done as efficiently as possible by generating a
hash range for all the buckets and thus avoiding a preflist
calculation for each key.  Only a hash of each key is done, it's range
determined from a bucket->range map, and then the hash is checked
against the range.  The services under repair (i.e. Search or KV) must
provide callback functions to generate these ranges since it is
specific to the service.

In order to not repeat code and capitalize on concurrency control the
repair mechanism is currently an extension of handoff.  This creates
some awkwardness as repair is _not_ handoff.  Some of the differences
include:

1. It needs to filter data during the fold

2. All vnodes involved are primary and thus repair _cannot_ block

3. Repair involves 3 distinct partitions and 3 distinct vnodes

4. Repair does not imply a change of responsibility from one vnode to
another, but is more a sharing of data

In the future the handoff subsystem should be rewritten around the
notion of "transfers" in which repair, handoff, and ownership are all
different logical operations but use the transfer mechanism
underneath.  Especially now that repair is in it should be more clear
what that system should look like to meet the goals of all 3.

The idea of repair lives in the vnode manager as it is very much a
vnode semantic.  This is important because other things like handoff
and ownership also affect vnodes and thus affect repair.  The vnode
manager controls the logical repair, but the handoff/transfer
mechanism controls the physical movement of replicas from source to
target.

For now, it seemed easiest and smartest to _not_ allow ownership
change and repair to run concurrently.  In the event that an ownership
change is detected all repairs will be hard killed, regardless of
status.

In the case were the low-level repair transfer is killed because of
`handoff_concurrency` a msg is _not_ sent back to the vnode mgr to
indicate a failure for that transfer.  Instead, the vnode mgr has a
period tick.  During each tick the vnode mgr checks the status of all
it's repairs and retries any transfers that have since died for a
reason other than completion.
Add ability to get all bucket props

It's useful to be able to get all the bucket properties in one go.
This is used by repair to get the `n_val` for all buckets.
Move common repair stuff into core

Place all common repair functions between Search and KV in the
`riak_core_repair` module.
Remove timeout in handoff mgr

This timeout was leftover from a previous attempt to write repair and
is not used anymore.
Fix dialyzer targets
Remove dead code

The `handoff_finished` msg is no longer used.  Instead the 'DOWN' msg
causes the xfer to be marked as complete.
Rename a few variables and fix typos
Remove intermediate handoff pid

Instead of using the handoff pid (`HPid`) "trick" in order to detect
vnode death and thus complicating the sender code make the handoff
manager be responsible for monitoring the vnode and kill the sender if
vnode death is detected.

As a refresher, the reason the `HPid` was introduced in the first
place is because vnode master `sync_command` will wait infinitely if
the vnode dies.  See commit `c44b086fd924f72809913c8059f4f02596b41548`
for more info.
Check `Reason` in vnode terminate

If the worker pool is busy doing something, or `Mod:terminate` does
blocking work, it could keep the vnode process in the `terminate`
callback for up to 60s.  This is bad because for that 60s msgs will be
queued up on the mailbox but then at the end of terminate they will
just drop.  In the case of normal termination you probably want to let
the worker finish it's work but a non-normal exit should bring down
the vnode quickly to allow it to restart.
Check for same node repair special case

If the source and target vnodes are on the same owner then don't
recursively call vnode manager to get the pid.  Otherwise, a deadlock
occurs.
Don't let `max_concurrency` crash handoff manager

Check for `{error, max_concurrency}` return from `send_handoff` and
create a `#handoff_status` with status of `max_concurrency` so that
it will be retried at the next available opportunity.

This is a bit hackish but if I put this code in `send_handoff` then I
have to modify how hinted handoff works.
Clarify types a bit

Remove some confusion around the handoff types.
Make xfer async and idempotent

The synchronous xfer call from vnode mgr to handoff mgr was very
brittle.  Firstly, the handoff sender needs the vnode pid and the pid
comes from the vnode manager but if the src and target partitions are
on the same node then a deadlock will occur when the handoff mgr tries
to get the pid from the vnode mgr which is still waiting for the
handoff mgr to return, thus a deadlock.  Secondly, errors can occur
during the call or max concurrency could be reached.

Rather than code for these cases it's easier to make the xfer API
idempotent and have the vnode manager constantly retry until it has
confirmation of a completed xfer.
Add chash API to `riak_core_ring`

Repair needs to get at the hash ring to build it's key filter.
Use existing `pending_changes` API

Don't bother with the wrapper and just match directly against list.
Pass in ring, extract chash

Rather than extracting the chash outside of core, pass the ring and
extract the chash there.
Simplify `check_up` implementation
Fix call to `trigger_ownership_handoff`

In a previous commit I changed the `trigger_ownership_handoff` to take
the transfers instead of the ring but forgot to update both places it
is called.