112 — WriteConflict
writetransactionconcurrency
Two concurrent operations attempted to modify the same document
What is happening?
A WriteConflict occurs when WiredTiger detects that two concurrent operations are trying to modify the same document. For single-document operations outside transactions, MongoDB automatically retries. Inside multi-document transactions, a WriteConflict may cause the transaction to abort, requiring the application to retry the entire transaction.
Common causes
- High write contention on the same document
- Long-running transactions holding write locks on frequently updated documents
- Hot documents receiving concurrent updates from multiple connections
- Missing transaction retry logic in the application