[SERVER-28978] Add hostname to $collStats output, and include shard name when run on a cluster Created: 26/Apr/17  Updated: 30/Oct/23  Resolved: 02/Aug/17

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: 3.4.0
Fix Version/s: 3.5.10

Type: Improvement Priority: Major - P3
Reporter: Kyle Suarez Assignee: Bernard Gorman
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Documented
is documented by DOCS-10449 Docs for SERVER-28978: Add hostname t... Closed
Related
related to SERVER-29546 Add hostname to standard $currentOp o... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2017-07-10
Participants:
Linked BF Score: 0

 Description   

$collStats has useful information when run on a mongod, but it's less useful when run on a mongos:

 shards:
        {  "_id" : "shard0000",  "host" : "celadon:20000",  "state" : 1 }
        {  "_id" : "shard0001",  "host" : "celadon:20001",  "state" : 1 }
  databases:
        {  "_id" : "test",  "primary" : "shard0000",  "partitioned" : true }
                test.coll
                        shard key: { "_id" : "hashed" }
                        unique: false
                        balancing: true
                        chunks:
                                shard0000       2
                                shard0001       3

mongos> db.coll.aggregate([{$collStats: {}}])
{ "ns" : "test.coll", "localTime" : ISODate("2017-04-26T14:18:29.066Z") }
{ "ns" : "test.coll", "localTime" : ISODate("2017-04-26T14:18:29.074Z") }

It would be useful if the result could also include information that identifies which mongod or which shard is associated with each result (for example, hostname and port).



 Comments   
Comment by Githook User [ 26/Jun/17 ]

Author:

{u'username': u'gormanb', u'name': u'Bernard Gorman', u'email': u'bernard.gorman@gmail.com'}

Message: SERVER-28978 Fix presplit behaviour in shard_host_info.js test
Branch: master
https://github.com/mongodb/mongo/commit/dee571928ef0b7adf39235e95c73e51fb6427d60

Comment by Githook User [ 23/Jun/17 ]

Author:

{u'username': u'gormanb', u'name': u'Bernard Gorman', u'email': u'bernard.gorman@gmail.com'}

Message: SERVER-28978 Add hostname to $collStats output, and include shard name when run on a cluster
Branch: master
https://github.com/mongodb/mongo/commit/cd37a0187a9559154bc9832e8fd559238e27905d

Generated at Thu Feb 08 04:19:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.