[SERVER-29678] collStats should return ok:1 and all fields when the namespace does not exist Created: 15/Jun/17 Updated: 09/Jan/24 Resolved: 02/Jul/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.1 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Shane Harvey | Assignee: | Ben Judd |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||||||||||||||||||
| Sprint: | Storage NYC 2018-07-02 | ||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Description |
|
The "collStats" command on non-existent namespace should be consistent with other commands on non-existent namespaces, and return success (ok:1) and similar to dbStats command should return a document similar in format to that for existing collection but with 0's for sizes. This will also make the $collStats aggregation stage behave consistently whether only latencyStats or storageStats are requested: currently latencyStats returns a document on non-existent namespace, but storageStats generates an error. There are no other aggregation stages that generate an error on a non-existent collection that I could find. Original description:
It should also return an error code, NamespaceNotFound would be a good choice:
|
| Comments |
| Comment by Ben Judd [ 02/Jul/18 ] |
|
Behavior is slightly different, used to return a ok:0 if there was no namespace, now it will return empty/0 result object. However, in the docs behavior in this case is left undefined so no changes are needed. |
| Comment by Githook User [ 02/Jul/18 ] |
|
Author: {'username': 'Icantjuddle', 'name': 'Ben Judd', 'email': 'ben.judd@10gen.com'}Message: |
| Comment by Ian Whalen (Inactive) [ 07/Jul/17 ] |
|
We believe that the new behaviour should be thus:
I'll now change the Summary to reflect this. |
| Comment by Ian Whalen (Inactive) [ 23/Jun/17 ] |
|
Definitely want the command + agg source to be consistent. asya will research whether returning an error code is the correct thing to do in both cases. |
| Comment by Kyle Suarez [ 16/Jun/17 ] |
|
Given that we've done |