-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
Labels:None
-
Fully Compatible
-
ALL
-
Query 2016-09-19
The $facet stage needs to override DocumentSource::needsPrimaryShard()|https://github.com/mongodb/mongo/blob/r3.3.11/src/mongo/db/pipeline/document_source.h#L221 to forward calls and see if any sub-stage needs the primary shard.
This can cause $facet stages containing a $lookup to run on a shard that does not have the collection being looked up from (as discovered when running jstests/aggregation/bugs/server19095.js through the passthrough suite from SERVER-25757)