2

I am planning a P2P collaborative editing software and I was planning on going with WOOT. The problem would have been that I would have had loads and loads of tombstones (atoms are characters...) so I searched more and found this PDF about the Logoot approach. Everything is clear to me apart from one thing: why does every site need a clock? I couldn't find anything in the document that mentions the purpose of this value.

Is there a situation which requires a clock to be solved without conflict?

tleb
  • 4,395
  • 3
  • 25
  • 33

2 Answers2

2

I was wondering this too. Not an official source, but according to the docs for npm's logoot package:

Note that vector clock values are not compared. Vector clock values are used to ensure unique atom identifiers, not for ordering.

Archagon
  • 2,470
  • 2
  • 25
  • 38
1

Is there a situation which requires a clock to be solved without conflict?

There is, and it took me way more time to realize that than i'm willing to admit:

Say we have an array A = [P] (where P is logoot position) and two clients C1 and C2.
C1 does this: delete(P), insert(P); local A = [P]
C2 does this: delete(P); local A = []

after C2 applies C1 operations it gets A = [P]
after C1 applies C2 operations it gets A = []
Oops.

Since logoot doesn't use tombstones a client could generate a position it itself deleted before, thus you need clock to avoid aforementioned situation.

i.trofimow
  • 11
  • 1