[SERVER-72843] Fix SBE stage builder to not use lambda closures Created: 13/Jan/23 Updated: 29/Oct/23 Resolved: 06/Feb/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.3.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Anna Wawrzyniak | Assignee: | Drew Paroski |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | pm2697-m2 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Assigned Teams: |
Query Execution
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Sprint: | QE 2023-02-06, QE 2023-02-20 | ||||
| Participants: | |||||
| Linked BF Score: | 135 | ||||
| Story Points: | 5 | ||||
| Description |
|
Fix SBE stage builder to not use lambda closures. Lambda closures are not supported and any translation that relies on lambda closures works by a pure coincidence, and may stop working at any time.
As part of fixing/verifying the fix, we should add asserts/verificiation when compiling EExpression that rejects compilation of accessing closure variables. Possibly by: a) verifying the EExpression itself b) by asserting during lambda compilation that there are no unbound variables leaking out of lambda body. This could be done by asserting that the collection of frames in empty inside CodeFragment::appendNoStack
Example of expression with lambda capture. l2.0 is used inside the nested lambda:
This expression comes from a projection generated by test: https://github.com/10gen/mongo/blob/master/jstests/aggregation/expressions/filter.js#L105
There could be other code paths that generate such expression.
|
| Comments |
| Comment by Githook User [ 06/Feb/23 ] |
|
Author: {'name': 'Drew Paroski', 'email': 'drew.paroski@mongodb.com', 'username': 'paroski'}Message: |