basho/riak_core — pull request #370 by jrwest (2013-09-05 18:44:31+00:00)
Title: Cluster Metadata (Part 2/2) - Hashtrees & Exchanges

This PR is the second of two comprising the initial version of Cluster Metadata. It builds on [part 1](https://github.com/basho/riak_core/pull/363), ensuring that all updates are delivered at-least once.

__This PR is targeted at `jrw-cluster-meta` not `develop` it should be merged there before part 1 is merged.__

This PR includes:

* hashtree.erl - the original hash tree from riak_kv (unmodified)
* hashtree_tree.erl - hashtree used by cluster metadata
* metadata hashtree exchanges and repair of divergent cluster metadata
* generalized exchange mechanism for riak_core_broadcast

(see commits for more details)

This PR does not yet include, but should before merge (into develop but to be safe lets say part 1):

* [ ] [hashtree documentation](https://github.com/basho/riak_kv/blob/develop/docs/hashtree.md) from basho/riak_kv
* [ ] riak_kv pull request to remove hashtree.erl and documentation (NOTE: need careful merge here to not break develop for people)

This PR does not include the following but i think it can be done concurrently with review and added to this PR or to new PRs:

* [ ] if a node crashes abnormally hashtrees stored in leveldb are not properly cleaned up
* [ ] there is some minor refactoring that could be done here and there (may also come up during review)
* [ ] `riak_core_broadcast` knows which modules will broadcast but does not validate it

This PR will not include:

* memory backed hashtree.erl (which was originally planned)