basho/riak_dt — pull request #45 by lenary (2013-07-15 15:03:08+00:00)
Title: Garbage Compaction Ideas - Do Not Merge

Just a central place to throw comments at these ideas about garbage compaction.

Flow is expected to be:
1. Work out Thresholds etc
2. check if ready for GC using `gc_ready/2`. If not ready, stop.
3. Acquire consensus (not included in this code), including making a new "epoch" somehow and electing leader
4. Leader calls `gc_propose/2` to get some kind of object that encapsulates what should be done to the CRDT
5. This object is broadcast to all replicas and they all (including the leader) call `gc_execute/2` with that object and the CRDT to actually compact.
6. Consensus is released.

Upon merge of a replica that has fallen behind with its compaction, it will first do any pending Compactions (got from the replica its trying to merge with) it hasn't already done, and then merge.