key garbage collection

Erik Søe Sørensen ess at trifork.com
Thu Nov 3 05:46:39 EDT 2011


On 03-11-2011 07:39, Justin Karneges wrote:
[snip]
> I wonder if anyone else is doing something like this.  I also wonder if there
> is a flaw in this design.  Since the lack of the cleanup key can indicate a
> successful commit, I wonder if there might be a problem with eventual
> consistency whereby some other node sees A and B but not the cleanup key
> because it hasn't propagated yet, and therefore thinks the keys are valid when
> in reality they aren't.  Maybe causal consistency ensures this isn't a
> problem, since the cleanup key is written before A and B?
If cluster-to-cluster replication is in play, there will be a problem 
here, because the replication order (for full syncs at least) is 
independent of the write order.

One other possibility: first write A with metadata "valid-if-exists: B", 
then write B.
Whether this works depends on what other kinds of updates might happen, 
of course.
This can be combined with either explicit scans for old invalid As, or 
with a cleanup log written before A.

/Erik




More information about the riak-users mailing list