Two Branches One Cart

A Dynamo-style store versions objects with vector clocks. Four versions of one key exist.

version clock how it arose
D1 [(Sx,1)] first write, coordinated by Sx
D2 [(Sx,2)] same client updates, Sx coordinates again
D3 [(Sx,2),(Sy,1)] same client updates D2, Sy coordinates
D4 [(Sx,2),(Sz,1)] a different client that had read D2 updates it, Sz coordinates

A node holding D3 receives D4. What happens, and if the client then reconciles and Sx coordinates the resulting write D5, what clock does D5 carry?

A

The node rejects D4 and asks Sz to retry, because a write may only be coordinated by a node already present in the object's clock.

B

Neither descends from the other, so both are kept and returned together on the next read. After reconciliation D5 carries [(Sx,3),(Sy,1),(Sz,1)].

C

Neither descends from the other, so both are kept. D5 carries [(Sx,2),(Sy,1),(Sz,1)], the element-wise maximum of the two clocks.

D

D4 overwrites D3. Both descend from D2, and D4 was written later, so last write wins and D5 carries [(Sx,2),(Sz,1)].