[SERVER-68691] $graphLookup does not report variable references for 'restrictSearchWithMatch' filter Created: 09/Aug/22 Updated: 29/Oct/23 Resolved: 31/Aug/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 6.0.0-rc13 |
| Fix Version/s: | 4.2.23, 4.4.17, 5.0.13, 6.0.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Nicholas Zolnierz | Assignee: | Nicholas Zolnierz |
| 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: |
v5.0, v4.4, v4.2
|
||||||||||||
| Sprint: | QO 2022-09-05 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
As part of $lookup sub-pipeline correlation analysis, we try to detect the largest prefix of the pipeline which is non-correlated and temporarily cache the result instead of re-running for each document in the outer pipeline. This optimization relies on each aggregation stage correctly reporting it's variable dependencies, which may include a variable defined in the 'let' of the $lookup. However $graphLookup does not fully report its dependencies for the 'restrictSearchWithMatch' option, which means if its contained in a $lookup sub-pipeline then it may be incorrectly treated as non-correlated. |
| Comments |
| Comment by Githook User [ 06/Sep/22 ] |
|
Author: {'name': 'Nicholas Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}Message: (cherry picked from commit 5521f98c392f8af2fbb678f3cbf8089b641d9dba) |
| Comment by Githook User [ 06/Sep/22 ] |
|
Author: {'name': 'Nicholas Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}Message: (cherry picked from commit 5521f98c392f8af2fbb678f3cbf8089b641d9dba) |
| Comment by Githook User [ 02/Sep/22 ] |
|
Author: {'name': 'Nicholas Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}Message: (cherry picked from commit 5521f98c392f8af2fbb678f3cbf8089b641d9dba) |
| Comment by Githook User [ 30/Aug/22 ] |
|
Author: {'name': 'Nicholas Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}Message: |
| Comment by Nicholas Zolnierz [ 09/Aug/22 ] |
|
Marking as related to |