When running two concurrent, multi-document transactions that try to insert document sets that have a non-empty intersection, one of the transactions should fail with a WriteConflict, since both transactions try to write to the same document. Instead, it appears that a DuplicateKey error is instead being thrown. See attached repro.
This is the transaction history being tested in the repro script:
Start(T1), Start(T2), Insert(T2, [d1, d2]), Commit(T2), Insert(T1, [d2, d3]), Commit(T1)
The first insert by T1 throws a DuplicateKey error. What is additionally odd is that the DuplicateKey error appears to be thrown on _id: 1, when we would expect the WriteConflict error to be thrown on _id: 2.
e.g.
"errmsg" : "E11000 duplicate key error collection: test.transactions_write_conflicts index: _id_ dup key: { : 1.0 }",
- is related to
-
SERVER-34648 Write test for all types of transaction write conflicts
- Closed