Subset of cases described in SERVER-14322 that can be safely retried as an upsert is when insert portion of update receives a duplicate key exception with duplicate key-values combination matching the query exactly.
Example:
db.foo.update({_id:5},{$set:{...}\},{upsert:true})
can safely retry full upsert if it receives error
"E11000 duplicate key error collection: bar.foo index: id dup key: { : 5.0 }"
- depends on
-
SERVER-38038 mongo shell should be linked with ErrorExtraInfo derivatives
- Closed
-
SERVER-38175 Invariant on error codes with ErrorExtraInfo for OperationContext markKilled() and timeout
- Closed
-
SERVER-14801 duplicate key error should report field names as well as values
- Closed
- is duplicated by
-
SERVER-14322 Retry on predicate unique index violations of update + upsert -> insert when possible
- Closed
-
SERVER-37532 Retry update on specific duplicate index exception during upsert
- Closed
- is related to
-
SERVER-47212 Retry full upsert path when duplicate key exception matches exact query predicate in findAndModify
- Closed
- related to
-
SERVER-38461 performSingleUpdateOpWithDupKeyRetry loops indefinitely
- Closed
-
SERVER-44980 wrong update result with upsert:true
- Closed
-
SERVER-50454 Avoiding sending the "keyValue" field to drivers on duplicate key error
- Closed