[DOCS-7802] Conflicting documentation on sorting in a sharded cluster Created: 03/May/16  Updated: 30/Oct/23

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Michael Clovis Assignee: Kay Kim (Inactive)
Resolution: Won't Do Votes: 0
Labels: Cleanup
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

All Environments


Participants:
Days since reply: 1 year, 14 weeks, 2 days ago
Epic Link: DOCSP-1769

 Description   

I am a TA at MongoDB U. There is conflicting and i believe dated information on how and where sorting occurs in a sharded cluster. It is our belief that with a sorted query NOT using the aggregation framework, the mongos router sends the query to the necessary shards where the results are fetched and sorted. That data is sent to the mongos router for a merge sort. If the sorted query uses the aggregation framework, each shard that is used to fetch and sort (prior to 3.2) would send the results to the primary shard for the merge sort which would then send the results to the mongos. After 3.2, if the primary shard is not used to fetch the data, the results can be sent to any of the shards that have been used for this query for the merge sort and then sent to the mongos.

The information in the FAQ https://docs.mongodb.org/manual/faq/sharding/#how-does-mongodb-sort-queries-in-sharded-environments
states this for non-aggregation queries.

The information in the manual
https://docs.mongodb.org/manual/core/sharded-cluster-query-router/
(How mongos Handles Query Modifiers) seems to be describing the aggregation queries but does not specify that. Also on that page it is stated "Changed in version 3.2: For aggregation operations that run on multiple shards, if the operations do not require running on the database’s primary shard, these operations can route the results to any shard to merge the results and avoid overloading the primary shard for that database.".

We believe that "How mongos Handles Query Modifiers" needs to be cleaned up to specify that this is for aggregation framework queries. it seems to be left over from earlier behavior (prior to 2.6)

If our understanding is incorrect, please advise.



 Comments   
Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Generated at Thu Feb 08 07:55:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.