[SERVER-35479] Make $collStats count behavior have "standard" error code and consistent behavior across topologies. Created: 07/Jun/18 Updated: 29/Oct/23 Resolved: 07/Dec/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying, Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Bernie Hackett | Assignee: | Sam Mercier |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | query-44-grooming, storch | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||
| Sprint: | Query 2020-11-30, Query 2020-12-14 | ||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||
| Description |
|
New Description: We have decided to fix the collstats count results. This ticket will track transitioning to a "standard" error code #26 Namespace doesn't exist, and ensuring that the result format is conforms to the format laid out in the scope document. Original Description: When the namespace does not exist $collStats behavior depends on the topology type. When connected to a mongos, the aggregate command returns no results:
When connected to a standalone server or replica set an undocumented, nonstandard error is returned (the error code is the same in both cases):
The behavior should be consistent regardless of topology. I think there are two choices for how to resolve this:
My personal preference is for the first option, which matches the behavior of $count:
|
| Comments |
| Comment by Githook User [ 15/Dec/20 ] |
|
Author: {'name': 'samontea', 'email': 'merciers.merciers@gmail.com', 'username': 'samontea'}Message: |
| Comment by Githook User [ 07/Dec/20 ] |
|
Author: {'name': 'samontea', 'email': 'merciers.merciers@gmail.com', 'username': 'samontea'}Message: |
| Comment by Asya Kamsky [ 13/Nov/20 ] |
|
It seems clear to me that for the user option one would be better and option two would be much much worse (backwards breaking and making things less consistent). |
| Comment by David Storch [ 08/Jun/18 ] |
|
I closed |
| Comment by Asya Kamsky [ 08/Jun/18 ] |
|
Even with db/collection that exists, $collStats seems to return as many documents as there are shards rather than a single result. |
| Comment by Kyle Suarez [ 07/Jun/18 ] |
|
I believe this is a duplicate of |