|
|
|
|
|
by hardwaresofton
2801 days ago
|
|
Sorry, I think either my fundamental understanding is off or I wasn't clear enough in how I was imagining this happening... If you and a majority of nodes agree on a value like an CRDT OpSet (more simplistically, just agreeing on the state of the log), how does that not guarantee agreement and serializability? It is impossible from that point on to have a another majority of nodes have some other view of what happened. Consensus algorithms are One copy serializability is exactly what would be achieved by having a read and write quorum[0][1]. It intuitively makes sense to me (and maybe my intuition is wrong), but if you talk to a majority of nodes and ask "this is what we all have, right?" before every write and every read, you've got a guaranteed consistent (of course, progress isn't guaranteed if partitions/nodes die, etc) state. AFAIK Quorums are the state of the art (and arguably the only relatively efficient option) as far as achieving serializability in a distributed system... [0]: https://en.wikipedia.org/wiki/Quorum_(distributed_computing)... [1]: https://arxiv.org/pdf/1406.7423.pdf |
|
You cannot know this, because the transaction replication is racy and not atomic--it may have applied to only one node while you are doing your read. Whether you see it or don't is luck. So you can have the following scenario (and in practice you will):
- TX commit begins
- TX replicated to node A
- Read from coordinator A' begins
- Read sees replica A (has tx) and replica B (does not)
- Read assumes A wins because of some kind of vector clock in the data value (choosing the older value doesn't make things better, just in case you are wondering)
- Read from coordinator B' begins
- Read sees B (no TX) and C (no TX)
- Read completes with stale value--serializability violation has occurred
- TX finishes replicating to B and C
This leaves aside write skew, torn transactions due to partitions, and all kinds of other problems.