News for hackers. Stuff that matters.
Re:Serializable, Lockless, Distributed: Isolation in Cockroa... by mrtracy on Wednesday May 04, 2016 @09:33PM (#11633340)
CockroachDB is optimistically concurrent, so there is not locking. However, your use case is definitely possible.

The transaction would: 1. Read the current document (i'm assuming this needs to be done to compute the translog). 2. Read the latest ID in the translog table 3. Write a new entry to translog with ID+1 4. Write the document.

If any other transaction interleaves with this process (by either reading or writing one of the same keys in a way that would violate isolation), one of the two transactions will be aborted.

There are no comments on this comment yet.