[SERVER-10831] Sorting doesn't work if sort key excluded in projection with a sharded collections Created: 20/Sep/13 Updated: 24/Nov/15 Resolved: 24/Nov/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying, Sharding |
| Affects Version/s: | 2.2.6, 2.5.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeff lee | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 4 |
| Labels: | query_triage | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Steps To Reproduce: | 1. Create a sharded cluster - 1 shard |
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
Hi, It looks like there was a behavior change between 2.0 and 2.2 that results in an error 13431 if you attempt to sort by a key that has been explicitly excluded in a projection when running a query via a mongos. I was just wondering if this is expected behavior.
|
| Comments |
| Comment by J Rassi [ 24/Nov/15 ] |
|
This has been fixed with the rewrite of the mongos query path. As of Closing as a dup of |
| Comment by Ken Williams [ 17/May/15 ] |
|
Regardless of whether this bug gets fixed or declared expected behavior, the error message could at least be changed to be more grammatical. I can't tell what it actually means. |
| Comment by pan shangbin [ 30/Nov/13 ] |
|
i have also find this bug in version 2.4.8 ).limit(5).sort( {"_id":-1}) |
| Comment by Eliot Horowitz (Inactive) [ 14/Oct/13 ] |
|
This is indeed a bug and not "works as designed" not should it be a limitation. Mongos should handle transparently. |
| Comment by Scott Hernandez (Inactive) [ 20/Sep/13 ] |
|
This is expected behavior for queries via mongos since they requires the data to do the merge sort. We can add this to the sharding restrictions page for future reference. Also, this code has not changed since before 2.0: https://github.com/mongodb/mongo/blob/v2.0/client/parallel.cpp#L396 |