-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: manual
-
Labels:
Description
The docs for "Aggregation Pipeline and Sharded Collections" https://docs.mongodb.com/manual/core/aggregation-pipeline-sharded-collections/ has a behavior section that says
"For aggregation operations that must run on multiple shards, if the operations do not require running on the database’s primary shard, these operations will route the results to a random shard to merge the results to avoid overloading the primary shard for that database. The $out stage and the $lookup stage require running on the database’s primary shard." (starting 3.2)
But the docs for mongos https://docs.mongodb.com/manual/core/sharded-cluster-query-router/#routing-and-results-process say
"Changed in version 3.6: For aggregation operations that run on multiple shards, if the operations do not require running on the database’s primary shard, these operations may route the results back to the mongos where the results are then merged."
I have confirmed with the query team that the latter behavior is correct and the first doc with the notes on the 3.2 behavior should be overwritten or caveat-ed.