Witnessing DCP Deletion event first when a document has been inserted with the Transaction API

What I think is going on:
It seems that the Transactions API on insertion creates these “lock” dummy documents in the database, which is then being overwritten by the original document on success.

Then, the DCP client receives a Deletion event for the same document ID first. Then, a Mutation event (for the actual insertion).

Am I right?


1 Like

Exactly right @zoltan.zvara.
Inserts are staged before the commit with a tombstone, which a) provides a place to store the staged data and b) prevents that same document from being inserted by other transactions. As it’s a tombstone it’s invisible to the rest of the Couchbase data platform, providing our read committed isolation level.

1 Like