cockroachdb/cockroach — pull request #238 by bdarnell (2014-12-19 20:49:43+00:00)
Title: WIP: Raft Storage implementation.

[I'm sending this out even though it's incomplete in case anyone wants to pick it up while I'm out]

storage.Store now implements the multiraft.Storage interface, and
storage.Range implements raft.Storage.

This change is not ready to merge; the tests are still failing. The
failures appear to mostly relate to the bootstrapping of the group
members. I think the solution is to construct an initial snapshot
instead of bootstrapping by appending to the log.

More details:
* storage.NewRange now reads the current raft log position, so it can
return an error.
* Converted to two-phase util.Stoppers in several places.
* Locking of Store.mu is somewhat delicate; raft operations cannot be
performed while this lock is held.
* multiraft.storage.LoadGroups is gone; we can't have raft initialize
itself independent of the application.
* Made a small tweak to the RPC interface to reduce log spam.
* All pending proposals are now re-submitted on leader elections.
* Added the beginnings of a raft.Storage test suite; this will be moved
into the etcd repo when it has stabilized.
* Range removal is not yet implemented.

@spencerkimball @cockroachdb/developers