[SERVER-66545] A collator should be passed as an argument to "generateSortKey" builtin in SBE Created: 18/May/22 Updated: 29/Oct/23 Resolved: 27/May/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Anton Korshunov | Assignee: | Anton Korshunov |
| 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: |
v6.0
|
||||||||||||
| Sprint: | QO 2022-05-16, QO 2022-05-30 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 61 | ||||||||||||
| Description |
|
Currently when we generate a generateSortKey expression in the SBE stage builder we construct a SortSpec argument, which is an SBE value holding some data required to generate a sort key. One of fields in the SortSpec is an unowned collator pointer, which we take from the CanonicalQuery. However, if this plan gets cached and we try to recover it from the cache, this pointer becomes stale. As a bare minimum we should clone the collator before stashing it into the plan, and perhaps make the key pattern BSON owned too. We can also try to explore a possibility of auto-parameterizing query collation. |
| Comments |
| Comment by Githook User [ 27/May/22 ] |
|
Author: {'name': 'Anton Korshunov', 'email': 'anton.korshunov@mongodb.com', 'username': 'antkorsh'}Message: |