When write_ops_exec::shouldRetryDuplicateKeyException() returns true, we retry findAndModify on DuplicateKey. I think the assumption is that the document didn't exist before the command starts. However, this assumption is false when the unique index is partial.
- is caused by
-
SERVER-47212 Retry full upsert path when duplicate key exception matches exact query predicate in findAndModify
-
- Closed
-
- related to
-
SERVER-95524 Avoid retrying on duplicate key error for upserts in multidocument transactions
-
- Closed
-