Skip to content

Commit

Permalink
Fix #238: Non-converging operations on unordered deletes.
Browse files Browse the repository at this point in the history
The problem: a replica may tombstone a value and then receive a new write for
that value that had happened BEFORE the tombstone from a different replica.
The final value/priority pair should be set to the value/priority that was not
tombstoned. However we did not do that. We knew the key was not tombstoned,
but the value returned corresponded to an update that was tombstoned.

The solution: every time a tombstone arrives, we need to look for the "best
value/priority", that is, we need to make sure that among all the key values
that we have, we set the best one that was not tombstoned according to the
CRDT rules (highest priority or lexicographical sorting when equal).

The consecuences: this makes tombstoning a more expensive operation but it
also allows us to remove value/priority altogether when all the values have
been tombstoned. As such, we don't need to check if a value has been
tombstoned anymore when doing Gets/List, before returning the element. That
saves lookups and that also means we no longer need to bloom filter, which was
supposed to speed up this operation. In general, datastore which mostly add
data will be better afterwards.
  • Loading branch information
hsanjuan committed Nov 11, 2024
1 parent 0f14947 commit 10a7dca
Showing 1 changed file with 156 additions and 177 deletions.
Loading

0 comments on commit 10a7dca

Please sign in to comment.