[SERVER-57869] Shell getShardDistribution helper does not accumulate chunk counts on 5.0.0-rc1 Created: 21/Jun/21  Updated: 29/Oct/23  Resolved: 06/Jul/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.2, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: John Morales Assignee: Allison Easton
Resolution: Fixed Votes: 0
Labels: neweng, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MongoDB 5.0.0-rc1


Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Sprint: Sharding EMEA 2021-07-12
Participants:

 Description   

Example:

/var/lib/mongodb-mms-automation/mongodb-linux-x86_64-5.0.0-rc1-ent/bin/mongo --port 57098
MongoDB shell version v5.0.0-rc1
...
MongoDB Enterprise mongos> db.bucket.chunks.getShardDistribution()
Shard m50-sh_0 at m50-sh_0/deployment-1.example.com:57000
 data : 1.4GiB docs : 4197 chunks : 0
 estimated data per chunk : 0B
 estimated docs per chunk : 0
Shard m50-sh_1 at m50-sh_1/deployment-2.example.com:57001
 data : 795.56MiB docs : 2327 chunks : 0
 estimated data per chunk : 0B
 estimated docs per chunk : 0
Shard m50-sh_4 at m50-sh_4/deployment-2.example.com:57004
 data : 858.12MiB docs : 2510 chunks : 0
 estimated data per chunk : 0B
 estimated docs per chunk : 0
Shard m50-sh_3 at m50-sh_3/deployment-1.example.com:57003
 data : 828.38MiB docs : 2423 chunks : 0
 estimated data per chunk : 0B
 estimated docs per chunk : 0
Shard m50-sh_5 at m50-sh_5/deployment-3.example.com:57005
 data : 795.22MiB docs : 2326 chunks : 0
 estimated data per chunk : 0B
 estimated docs per chunk : 0
Shard m50-sh_2 at m50-sh_2/deployment-3.example.com:57002
 data : 857.1MiB docs : 2507 chunks : 0
 estimated data per chunk : 0B
 estimated docs per chunk : 0
Totals
 data : 5.43GiB docs : 16290 chunks : 0
 Shard m50-sh_0 contains 25.76% data, 25.76% docs in cluster, avg obj size on shard : 350KiB
 Shard m50-sh_1 contains 14.28% data, 14.28% docs in cluster, avg obj size on shard : 350KiB
 Shard m50-sh_4 contains 15.4% data, 15.4% docs in cluster, avg obj size on shard : 350KiB
 Shard m50-sh_3 contains 14.87% data, 14.87% docs in cluster, avg obj size on shard : 350KiB
 Shard m50-sh_5 contains 14.27% data, 14.27% docs in cluster, avg obj size on shard : 350KiB
 Shard m50-sh_2 contains 15.38% data, 15.38% docs in cluster, avg obj size on shard : 350KiB

I.e., all the chunks : 0

This is presumably due to the change in MongoDB 5.0 config.chunks collection no longer having the "ns" field.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 22/Jul/21 ]

Author:

{'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com'}

Message: SERVER-57869 Extending Shell getShardDistribution helper to handle new metadata format of config.chunks
Branch: v5.0
https://github.com/mongodb/mongo/commit/eef280545f429db95bdecbf7ad0d92ee079822f2

Comment by Githook User [ 06/Jul/21 ]

Author:

{'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com'}

Message: SERVER-57869 Extending Shell getShardDistribution helper to handle new metadata format of config.chunks
Branch: master
https://github.com/mongodb/mongo/commit/d08c26c369053ea8565c033ae8a9f446607f6d6c

Comment by Anna Henningsen [ 21/Jun/21 ]

Fwiw, here’s what we did in mongosh for this: https://github.com/mongodb-js/mongosh/commit/cf7a96530f6320f1b0b4b859e525de5cfba0089b

(Note that sh.status() was also affected)

Generated at Thu Feb 08 05:43:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.