[SERVER-21976] dataSize cmd should ignore current database in mongos Created: 21/Dec/15 Updated: 16/Mar/16 Resolved: 08/Mar/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 3.3.3 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kyle Suarez | Assignee: | Dianna Hohensee (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | command, mongos, neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Sharding 11 (03/11/16) | ||||||||
| Participants: | |||||||||
| Description |
|
When running dataSize in a mongos, the command only works when the current database matches the database of the collection whose size you're trying to measure. For example, if I have a collection test.users, this works:
However, if the current database is not test, then the shell erroneously reports that the collection is empty:
Since the full namespace is required for the command, it makes no sense to consider the currently active database. This problem only occurs when connected to a mongos. If I connect directly to a mongod, dataSize correctly gives me the collection size no matter what the currently active database is:
|
| Comments |
| Comment by Githook User [ 08/Mar/16 ] |
|
Author: {u'username': u'DiannaHohensee', u'name': u'Dianna Hohensee', u'email': u'dianna.hohensee@10gen.com'}Message: |
| Comment by Githook User [ 08/Jan/16 ] |
|
Author: {u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'kyle.suarez@mongodb.com'}Message: When connected to a mongos, the `dataSize` command must be run in the context of See Signed-off-by: Andrew Aldridge <i80and@foxquill.com> |
| Comment by Kyle Suarez [ 22/Dec/15 ] |
|
Awesome, thanks. The documentation page for dataSize is here; I don't think it requires updating but I can refactor it if the sharding team thinks it needs to be revisited. |
| Comment by Kelsey Schubert [ 22/Dec/15 ] |
|
Thanks Kyle - I'm sending this to the sharding team to triage. |