dominictarr / crdt

Commutative Replicated Data Types for easy collaborative/distributed systems.
MIT License
836 stars 43 forks source link

Can't make partial changes to rows #4

Closed Raynos closed 12 years ago

Raynos commented 12 years ago

Consider peer X and peer Y which each have a row.

Now let peer X do row.set("one", "one") and peer Y do row.set("two", "two")

This propagates messages [row.id, { one: one }, ts1, source] and [row.id, { two: two }, ts2, source]

For normative purposes let ts1 < ts2

Now if any peer gets these messages in order of ts2 followed by ts1 then we lose the set("one", "one") message because it's older and ignored.

Raynos commented 12 years ago

I think this is simply a misunderstanding of how crdt works

dominictarr commented 12 years ago

That is a bug. Each source gets it's own timer. A message should only be ignored if there is a more recent message for that source

Raynos commented 12 years ago

@dominictarr does that mean that if we send crdt messages over UDP then messages can arrive in the wrong order and not get applied?

dominictarr commented 12 years ago

yeah, scuttlebutt depends on correct ordering.

if you where using udp, I'm assuming for an action game, you might have different assumptions. maybe just send the whole row, or something.

On Mon, Aug 27, 2012 at 9:49 AM, Raynos notifications@github.com wrote:

@dominictarr https://github.com/dominictarr does that mean that if we send crdt messages over UDP then messages can arrive in the wrong order and not get applied?

— Reply to this email directly or view it on GitHubhttps://github.com/dominictarr/crdt/issues/4#issuecomment-8049089.

Raynos commented 12 years ago

@dominictarr I'm going to assume this is a non issue because I havn't reproduced it recently.