[SERVER-60152] Undefined slot accessor s6 in $bucket translation Created: 22/Sep/21 Updated: 29/Oct/23 Resolved: 23/Sep/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Eric Cox (Inactive) | Assignee: | Yoon Soo Kim |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible | |||||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | |||||||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: | Start a mongod with the `featureFlagSBEGroupPushdown` flag on,
In the shell
The best place to drop the DebugPrinter statement is here,
|
|||||||||||||||||||||||||||||||||||||||||||
| Sprint: | QE 2021-10-04 | |||||||||||||||||||||||||||||||||||||||||||
| Participants: |
| Description |
|
When we generate the sub-tree for the _id expression of $bucket we end up with a giant plan that has s6 as an undefined slot accessor,
Note: I believe there's another build failure due to the same issue, it might be nice to see if this fix also fixes this failure, |
| Comments |
| Comment by Vivian Ge (Inactive) [ 06/Oct/21 ] | |||||||||||||||||||||||||||||||||
|
Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you! | |||||||||||||||||||||||||||||||||
| Comment by Githook User [ 23/Sep/21 ] | |||||||||||||||||||||||||||||||||
|
Author: {'name': 'Yoonsoo Kim', 'email': 'yoonsoo.kim@mongodb.com', 'username': 'yun-soo'}Message: | |||||||||||||||||||||||||||||||||
| Comment by Yoon Soo Kim [ 22/Sep/21 ] | |||||||||||||||||||||||||||||||||
|
The root cause was generateExpression expects that EvalStage stage param has a valid outSlot but was not given. So, generated top nlj could not set up correlated slot(s) properly. | |||||||||||||||||||||||||||||||||
| Comment by Yoon Soo Kim [ 22/Sep/21 ] | |||||||||||||||||||||||||||||||||
|
For coll.aggregate([{$bucket: {groupBy: "$num", boundaries: ["1", "10"]}}])'s id expression, got the following plan tree.
nlj's inner side refers to s5 but we didn't set up correlated slots properly for nlj. nlj [] [] should nlj [s5] [s5] | |||||||||||||||||||||||||||||||||
| Comment by Yoon Soo Kim [ 22/Sep/21 ] | |||||||||||||||||||||||||||||||||
|
It looks like there might be a bug in converting boundaries to $switch, looking at the following output:
There is supposed to be a case for "1000" above. Instead, we got an error: "$switch could not find a matching branch for an input, and no default was specified". Likely we missed adding "default" case when we convert $bucket's boundaries to $switch. Update: this was not relevant to a root cause. Please, disregard this comment. | |||||||||||||||||||||||||||||||||
| Comment by Yoon Soo Kim [ 22/Sep/21 ] | |||||||||||||||||||||||||||||||||
|
eric.cox, thanks for the minimal repro! |