[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:
Backports
Depends
is depended on by SERVER-68044 Segmentation fault in CollatorInterfa... Closed
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: SERVER-66545 Collator should be passed as an argument to "generateSortKey" builtin in SBE
Branch: master
https://github.com/mongodb/mongo/commit/7a87b42de9fd34123caf6c81ff75835e3b5c8e23

Generated at Thu Feb 08 06:05:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.