-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Query Execution
-
Fully Compatible
-
v8.0, v7.0, v6.0
Currently if upsert fails with duplicate key error because of a unique index, we might retry it if the query exactly matches the unique index.
This is done to allow for two concurrent upserts of the same documents to succeed.
However, if the unique index has collation, we won't retry because of this check where we compare index key to query predicate value: https://github.com/mongodb/mongo/blob/83a7377aa1071cf07d7ef9c8a4f3fdee782f7c5b/src/mongo/db/ops/write_ops_exec.cpp#L2275
But if index has collation, the key there would be CollationKey, not raw value. So this check is never passed.
This is was discovered during fix for SERVER-84089
- depends on
-
SERVER-84089 Bulk operation freezes if used in combination with collation and upsert
- Closed