mongodb
concurrency_error
ai_generated
true
MongoServerError: WriteConflict
ID: mongodb/write-conflict
78%Fix Rate
83%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 7 | active | — | — | — |
Root Cause
WiredTiger write conflict during concurrent updates.
genericWorkarounds
-
90% success Retry transaction with exponential backoff
Use retryable writes or session.withTransaction()
-
85% success Reduce transaction scope and duration
Dead Ends
Common approaches that don't work:
-
Add global lock around all writes
88% fail
Destroys concurrency, massive perf hit
-
Increase WiredTiger cache to all RAM
82% fail
OS starvation, OOM killer