[SERVER-39166] $graphLookup should force a pipeline to split in sharded cluster Created: 23/Jan/19 Updated: 29/Oct/23 Resolved: 29/Jan/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 3.4.0, 3.6.0, 4.0.0 |
| Fix Version/s: | 3.4.20, 3.6.11, 4.0.7, 4.1.8 |
| Type: | Bug | Priority: | Blocker - P1 |
| Reporter: | Charlie Swanson | Assignee: | Martin Neupauer |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | SWNA | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Backport Requested: |
v4.0, v3.6, v3.4
|
||||
| Sprint: | Query 2019-02-11 | ||||
| Participants: | |||||
| Description |
|
The $graphLookup stage does not inherit from NeedsMergerDocumentSource, which means that it is eligible to execute in parallel on all shards. This doesn't work because it will only ever do the searching locally. Instead, it should force itself to split the pipeline and execute in the merging half of the pipeline so that it can always run on the primary shard for the database. The $graphLookup StageConstraints are correct in saying that it must run on the primary shard, but this would only apply if some other stage before $graphLookup forced the pipeline to split. For example, see the following running against a mongos:
|
| Comments |
| Comment by Githook User [ 19/Feb/19 ] |
|
Author: {'name': 'Martin Neupauer', 'email': 'martin.neupauer@mongodb.com', 'username': 'MartinNeupauer'}Message: (cherry picked from commit b8231a4b5a25a957219c9c2e6b51f93c674e0b37) |
| Comment by Githook User [ 14/Feb/19 ] |
|
Author: {'name': 'Martin Neupauer', 'email': 'martin.neupauer@mongodb.com', 'username': 'MartinNeupauer'}Message: |
| Comment by Githook User [ 13/Feb/19 ] |
|
Author: {'name': 'Martin Neupauer', 'email': 'martin.neupauer@mongodb.com', 'username': 'MartinNeupauer'}Message: |
| Comment by Githook User [ 30/Jan/19 ] |
|
Author: {'email': 'martin.neupauer@mongodb.com', 'name': 'Martin Neupauer'}Message: |
| Comment by Githook User [ 29/Jan/19 ] |
|
Author: {'username': 'MartinNeupauer', 'email': 'martin.neupauer@mongodb.com', 'name': 'Martin Neupauer'}Message: |
| Comment by Charlie Swanson [ 23/Jan/19 ] |
|
martin.neupauer has a patch that will fix this on master as part of |