[SERVER-14968] sh.status(): order shards for sharded collections stats Created: 20/Aug/14  Updated: 25/Jun/15  Resolved: 26/Oct/14

Status: Closed
Project: Core Server
Component/s: Sharding, Usability
Affects Version/s: 2.6.4
Fix Version/s: 2.7.2

Type: Improvement Priority: Minor - P4
Reporter: Alexander Komyagin Assignee: Greg Studer
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-13985 printShardingStatus uses group/JS Closed
Participants:

 Description   

Currently sh.status() outputs shards (along with chunk counts) for each sharded collection in what appears to be a random order. In environments with 20+ shards and similar shard names (e.g. shard-xxx) it's really hard to locate a particular shard there to check how many chunks does it have.

--- Sharding Status ---
  sharding version: { "_id" : 1, "version" : 3 }
  shards:
    {  "_id" : "shard0000",  "host" : "m0.example.net:30001" }
    {  "_id" : "shard0001",  "host" : "m3.example2.net:50000" }
  databases:
    {  "_id" : "admin",  "partitioned" : false,  "primary" : "config" }
    {  "_id" : "contacts",  "partitioned" : true,  "primary" : "shard0000" }
        foo.contacts
            shard key: { "zip" : 1 }
            chunks:
                shard0001    2
                shard0002    3
                shard0000    2
            { "zip" : { "$minKey" : 1 } } -->> { "zip" : "56000" } on : shard0001 { "t" : 2, "i" : 0 }
            { "zip" : 56000 } -->> { "zip" : "56800" } on : shard0002 { "t" : 3, "i" : 4 }
            { "zip" : 56800 } -->> { "zip" : "57088" } on : shard0002 { "t" : 4, "i" : 2 }
            { "zip" : 57088 } -->> { "zip" : "57500" } on : shard0002 { "t" : 4, "i" : 3 }
            { "zip" : 57500 } -->> { "zip" : "58140" } on : shard0001 { "t" : 4, "i" : 0 }
            { "zip" : 58140 } -->> { "zip" : "59000" } on : shard0000 { "t" : 4, "i" : 1 }
            { "zip" : 59000 } -->> { "zip" : { "$maxKey" : 1 } } on : shard0000 { "t" : 3, "i" : 3 }
    {  "_id" : "test",  "partitioned" : false,  "primary" : "shard0000" }

It will be very useful to order shards by name (lex).



 Comments   
Comment by Daniel Pasette (Inactive) [ 26/Oct/14 ]

This was fixed with SERVER-13985.

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