[SERVER-38716] fix $geoNear and $text within $lookup sub-pipeline Created: 19/Dec/18 Updated: 29/Oct/23 Resolved: 17/Jan/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 3.6.9, 4.0.5, 4.1.7 |
| Fix Version/s: | 4.1.8 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Brigitte Lamarche (Inactive) | Assignee: | Brigitte Lamarche (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Sprint: | Query 2019-01-14, Query 2019-01-28 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
When a $geoNear stage is part of a $lookup stage's pipeline, this aggregation will fail with error code 50860. Attached is a script which can be used to reproduce this error by running it from the jstests/aggregation/sources/lookup directory: buildscripts/resmoke.py --suites='aggregation' jstests/aggregation/sources/lookup/lookup_subpipeline_geonear.js Part of fixing this test will include making sure this works in the sharded case, and adding test coverage for $geoNear within a $lookup subpipeline. This will include testing that this works with $geoNear using a $$ variable within the query option. For example:
This does not affect 4.0. |
| Comments |
| Comment by Githook User [ 17/Jan/19 ] | ||||||||||||||||
|
Author: {'username': 'bLamarche413', 'email': 'thesisiwbl@gmail.com', 'name': 'Brigitte Lamarche'}Message: | ||||||||||||||||
| Comment by Asya Kamsky [ 02/Jan/19 ] | ||||||||||||||||
|
The problem I pointed out is happening in 4.0 so it might be a different issue entirely. | ||||||||||||||||
| Comment by Asya Kamsky [ 02/Jan/19 ] | ||||||||||||||||
|
For $geoNear, when I use {_id:"$$var"} as match expression (query in $geoNear agg stage) it correctly matches documents which have _id value literal string "$$var". However, when I change query to use $expr to inject a variable, it works as a stand-alone agg stage but not as expressive $lookup.
| ||||||||||||||||
| Comment by David Storch [ 21/Dec/18 ] | ||||||||||||||||
|
While working on this further, brigitte.lamarche and I noticed that there is a similar bug for $text. The aggregation in the following repro script fails:
Unlike the $geoNear case, the $text bug affects 4.0 and 3.6. The fix for both $geoNear and $text will be the same, so we should consider backporting it. | ||||||||||||||||
| Comment by David Storch [ 21/Dec/18 ] | ||||||||||||||||
|
This is a really good catch brigitte.lamarche. Nice work! |