The update query executor runs the document insert inside a WriteUnitOfWork. When run atomically, the applyOps command also wraps lower level function calls (such as upsert) in a WriteUnitOfWork This may lead to an invariant when a WriteConflictException is thrown while inserting the document as part of an upsert.
To reproduce this issue, run the following JS test code using resmoke.py with --repeat=100:
load("jstests/replsets/libs/apply_ops_insert_write_conflict.js");
new ApplyOpsInsertWriteConflictTest({
testName: 'apply_ops_insert_write_conflict_atomic',
atomic: true
}).run();
- is related to
-
SERVER-30049 applyOperation_inlock() allows exceptions from Collection::insertDocument() to percolate to caller
-
- Closed
-
-
SERVER-31087 adorn secondary updates with timestamps
-
- Closed
-