[SERVER-5705] make db.printShardingStatus() print the shard key for every sharded collection Created: 25/Apr/12  Updated: 11/Jul/16  Resolved: 04/Sep/12

Status: Closed
Project: Core Server
Component/s: Sharding, Shell
Affects Version/s: None
Fix Version/s: 2.3.0

Type: Improvement Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Comments   
Comment by auto [ 04/Sep/12 ]

Author:

{u'date': u'2012-08-08T14:57:06-07:00', u'email': u'spencer@10gen.com', u'name': u'Spencer T Brody'}

Message: Make printShardingStatus print the shard key. SERVER-5705
Branch: master
https://github.com/mongodb/mongo/commit/b4201a6ec87a1fa0b381bd77977440b7a2fef306

Comment by Spencer Brody (Inactive) [ 08/Aug/12 ]

Proposed format:

> db.printShardingStatus()
--- Sharding Status --- 
  sharding version: { "_id" : 1, "version" : 3 }
  shards:
        {  "_id" : "shard0000",  "host" : "ubuntu:11111" }
        {  "_id" : "shard0001",  "host" : "ubuntu:22222" }
        {  "_id" : "shard0002",  "host" : "ubuntu:33333" }
  databases:
        {  "_id" : "test",  "partitioned" : true,  "primary" : "shard0000" }
                test.bar
                        shard key: { "i" : 1 }
                        chunks:
                                shard0000       1
                        { "i" : { $minKey : 1 } } -->> { "i" : { $maxKey : 1 } } on : shard0000 Timestamp(1000, 0) 
                test.foo
                        shard key: { "_id" : 1 }
                        chunks:
                                shard0000       3
                                shard0001       2
                                shard0002       3
                        { "_id" : { $minKey : 1 } } -->> { "_id" : 0 } on : shard0000 Timestamp(2000, 1) 
                        { "_id" : 0 } -->> { "_id" : 7 } on : shard0000 Timestamp(1000, 3) 
                        { "_id" : 7 } -->> { "_id" : 23 } on : shard0001 Timestamp(3000, 1) 
                        { "_id" : 23 } -->> { "_id" : 38 } on : shard0001 Timestamp(4000, 0) 
                        { "_id" : 38 } -->> { "_id" : 54 } on : shard0000 Timestamp(5000, 0) 
                        { "_id" : 54 } -->> { "_id" : 71 } on : shard0002 Timestamp(5000, 1) 
                        { "_id" : 71 } -->> { "_id" : 86 } on : shard0002 Timestamp(3000, 8) 
                        { "_id" : 86 } -->> { "_id" : { $maxKey : 1 } } on : shard0002 Timestamp(3000, 9) 
        {  "_id" : "admin",  "partitioned" : false,  "primary" : "config" }
        {  "_id" : "test2",  "partitioned" : false,  "primary" : "shard0000" }

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