vlcn-io / cr-sqlite

Convergent, Replicated SQLite. Multi-writer and CRDT support for SQLite
https://vlcn.io
MIT License
2.61k stars 69 forks source link

Revert "use db_version for col_version" #405

Closed tantaman closed 7 months ago

tantaman commented 7 months ago

Reverts vlcn-io/cr-sqlite#386

tantaman commented 7 months ago

This breaks the previous causal relationships we had for cells.

In other words, if an agent never saw updates to a cell then writes the cell, they could win that write everywhere because of a large db version.

Keeping the column independently versioned means that the happens-before relationship is tied directly to the cell itself.

We do lose the ability to set many columns together, however. This guarantee only existed if the columns in question were always set together on all nodes though.

E.g.,

set x, y is always issued on every node.

tantaman commented 7 months ago

Also revert : https://github.com/vlcn-io/cr-sqlite/pull/393

https://github.com/vlcn-io/cr-sqlite/pull/393 can't be automatically reverted so I'll need to handle this manually.