basho/riak_dt — pull request #46 by lenary (2013-07-27 12:28:26+00:00)
Title: Fragment-based GC

Taking all the good ideas from #45 and essentially starting again.

Flow is expected to be:
1. Work out Thresholds etc, for the meta-object (this includes making a new epoch, maybe)
2. check if ready for GC using `gc_ready/2`. If not ready, stop.
3. Acquire consensus (not included in this code), including electing leader
4. Leader calls `gc_get_fragment/2` to get the fragment of the CRDT that should be removed (for saving somewhere else)
5. This fragment is broadcast to all replicas and they all (including the leader) call `gc_replace_fragment/3` with that object and the CRDT. This is the compaction step.
6. Consensus is released.

The meta object contains data on primary actors, readonly actors (cluster remote views), epoch, and a threshold of how many actors are allowed compared to the number of primary+readonly actors.

I'm going to close #45, but the ideas are still in my head.