[DOCS-8589] Comment on: "manual/reference/method/db.collection.getShardDistribution.txt" Created: 13/Aug/16  Updated: 30/Oct/23  Resolved: 08/Jul/19

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: collector-298ba4e7, docs-triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Two shards:shard01,shard02

Location: https://docs.mongodb.com/manual/reference/method/db.collection.getShardDistribution/
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Referrer: https://www.baidu.com/link?url=Ew6FyrPMlY37rUyp90UX8X7DsebDUkHmK7FPvF_K_0G5Fk1bm6dmAh2Hj94gXJrEQPp5Vh0SrKsoTu2ejUkrzQjAFin-u-AVm2RIwN6BSkqRDwLGDnuopL1Db3tLTNzO&wd=&eqid=add8ccbf000bfaa30000000357ae5c70
Screen Resolution: 1366 x 768


Issue Links:
Related
related to DOCS-12839 The Build Indexes on Replica Sets doc... Closed
Participants:
Days since reply: 4 years, 31 weeks, 2 days ago
Epic Link: DOCSP-1769

 Description   

I run into a problem :
my collection was enabled sharding,i can see the Chunk distribution through sh.status(),and this is output:
chunks:
shard01 3
shard02 16
But i can not see the details of shard01 through db.collection.getShardDistribution(),here is out put:

Shard shard02 at shard02/mongo01:27018,mongo02:27018
data : 418.32MiB docs : 141345 chunks : 16
estimated data per chunk : 26.14MiB
estimated docs per chunk : 8834

Totals
data : 418.32MiB docs : 141345 chunks : 16
Shard shard02 contains 100% data, 100% docs in cluster, avg obj size on shard : 3KiB

Is it a bug or something? Any help would means a lot.



 Comments   
Comment by Githook User [ 08/Jul/19 ]

Author:

{'name': 'Kay Kim', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}

Message: DOCS-8589: as a prereq to getSharDistribution, run flushRouterConfig
Branch: v3.4
https://github.com/mongodb/docs/commit/9a7d26c71521ce6c32bd65ce56bf6d42ffe838ff

Comment by Githook User [ 08/Jul/19 ]

Author:

{'name': 'Kay Kim', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}

Message: DOCS-8589: as a prereq to getSharDistribution, run flushRouterConfig
Branch: v4.0
https://github.com/mongodb/docs/commit/41bff085c83f9ea8b91d690f37ffc2cd1865cfe0

Comment by Githook User [ 08/Jul/19 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-8589: as a prereq to getSharDistribution, run flushRouterConfig
Branch: v3.6
https://github.com/mongodb/docs/commit/040cf0ed71c796eed3d33b70dbd4c298eceb47b2

Comment by Githook User [ 08/Jul/19 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-8589: as a prereq to getSharDistribution, run flushRouterConfig
Branch: master
https://github.com/mongodb/docs/commit/427855d65ec59c28ac76e877c113c972b57a2aa2

Comment by Kay Kim (Inactive) [ 08/Jul/19 ]

Huzzah – was able to reproduce. Reopening to add a prereq to refresh the router's cache.

Comment by Kay Kim (Inactive) [ 18/Oct/18 ]

Unfortunately, cannot reproduce the issue.
running sh.status() on mongos gives me:

 test.rangezone
                        shard key: { "x" : 1 }
                        unique: false
                        balancing: true
                        chunks:
                                shardA	2
                                shardB	1

Then running getShardDistribution (also on mongos) returns:

mongos> db.rangezone.getShardDistribution()
 
Shard shardB at shardB/...
 data : 319KiB docs : 9910 chunks : 1
 estimated data per chunk : 319KiB
 estimated docs per chunk : 9910
 
Shard shardA at shardA/...
 data : 325KiB docs : 10090 chunks : 2
 estimated data per chunk : 162KiB
 estimated docs per chunk : 5045
 
Totals
 data : 644KiB docs : 20000 chunks : 3
 Shard shardB contains 49.55% data, 49.55% docs in cluster, avg obj size on shard : 33B
 Shard shardA contains 50.44% data, 50.44% docs in cluster, avg obj size on shard : 33B

Generated at Thu Feb 08 07:56:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.