[SERVER-79893] 6.0.x Enterprise Advanced: sharded databases always shows "partitioned: false" Created: 10/Aug/23 Updated: 27/Oct/23 Resolved: 17/Aug/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 6.0.9 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Gary Taylor | Assignee: | Tommaso Tocci |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
|||||||||||||||||||||||||||||||||||||||||||||||
| Assigned Teams: |
Sharding EMEA
|
|||||||||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | |||||||||||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: | MongoDB 6.0.9 Enterprise Advanced (EA) used (other 6.0.x versions also have same issue - maybe all?)
|
|||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | Sharding EMEA 2023-08-21 | |||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | ||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
I understand that enableSharding() for a database is not required in 6.0; However, sharded databases are always showing "partitioned: false" in sh.status(). Regardless of whether a database is enabled for sharding explicitly by enableSharding(<dbname>) (which isn't required as mentioned earlier) or by directly sharding the database.collection as described here: https://www.mongodb.com/docs/manual/reference/method/sh.shardCollection/#sh.shardcollection-- The database reports is always reporting "partitioned: false" in sh.status(). Having a database reporting "partitioned: false" when it has actually been sharded prevents some commands from reporting correctly such as: 1) Finding what databases are actually sharded: db.getSiblingDB('config').databases.find({partitioned: true}) 2) Finding number of bytes in unsharded collections across the cluster as shown in this Knowledge Base article:
Assuming this is a bug. |
| Comments |
| Comment by Tommaso Tocci [ 17/Aug/23 ] | ||||||||||||||||||
gary.taylor@mongodb.com you can use the following aggreagation to retrieve the sharded collections grouped by database name:
| ||||||||||||||||||
| Comment by Gary Taylor [ 10/Aug/23 ] | ||||||||||||||||||
|
I found some related tickets that seem to indicate this is known and expected/acceptable starting n 6.0. Those tickets are And this in the documentation: https://www.mongodb.com/docs/manual/reference/method/sh.status/#mongodb-data-sh.status.databases.partitioned Given the above then I can accept that this ticket can be closed but I wanted to provide some feedback below: If the flag isn't useful anymore - why still have it? The documentation links states its still there for backwards compatibility BUT if it doesn't reflect the correct status then any script like in the KB for finding the size of unsharded collections will not give the correct results and the user of that script may not be aware that is the case. Also, what is the best (quickest) way to check to see what databases have sharded collections. Would it be the following:
Or maybe something like this to get just the unique database names:
|