[SERVER-46863] findAndModify hits collator mismatch invariant when collection has non-simple default collation Created: 13/Mar/20 Updated: 29/Oct/23 Resolved: 31/Mar/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.0-rc0, 4.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Bernard Gorman | Assignee: | Ian Boros |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
|||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | |||||||||||||||||||||
| Operating System: | ALL | |||||||||||||||||||||
| Backport Requested: |
v4.4
|
|||||||||||||||||||||
| Steps To Reproduce: |
|
|||||||||||||||||||||
| Sprint: | Query 2020-04-06 | |||||||||||||||||||||
| Participants: | ||||||||||||||||||||||
| Linked BF Score: | 5 | |||||||||||||||||||||
| Description |
|
A findAndModify with an equality query on _id, an update, a projection, and no explicit collation will hit an invariant when run on a collection with a non-simple default collation, due to a mismatch between the collator set on the ExpressionContext and the collator parsed by CanonicalQuery from the QueryRequest. When running findAndModify under the conditions outlined above:
This bug was introduced in |
| Comments |
| Comment by Githook User [ 31/Mar/20 ] |
|
Author: {'name': 'Ian Boros', 'email': 'ian.boros@mongodb.com', 'username': 'puppyofkosh'}Message: (cherry picked from commit f105232d6594336e35cfee8f7f6d4ef49182ce84) |
| Comment by Githook User [ 31/Mar/20 ] |
|
Author: {'name': 'Ian Boros', 'email': 'ian.boros@mongodb.com', 'username': 'puppyofkosh'}Message: |
| Comment by Ian Boros [ 20/Mar/20 ] |
|
A few notes: This does not appear to be an issue for the delete command either, though its execution machinery is constructed in a similar manner. This is because there's no need to set the collation on the ParsedDelete before canonicalizing the query, as is done with update. |
| Comment by Bernard Gorman [ 13/Mar/20 ] |
|
Note: this bug will also manifest if the findAndModify request has a hint instead of a projection (or has both). |