Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-10449

Docs for SERVER-28978: Add hostname to $collStats output, and include shard name when run on a cluster

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.10
    • Component/s: Server
    • # Replies:
      1
    • Last comment by Customer:
      true
    • Sprint:
      KANBAN BUCKET

      Description

      Documentation Request Summary:

      The output format section of the $collStats documentation will need to note that the shardname and hostname are now displayed between the 'ns' and 'localTime' fields of the returned document. While the hostname will always be present, the shard name will be omitted if the mongoD is not part of a cluster.

      Engineering Ticket 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).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jonathan.destefano Jonathan DeStefano
              Reporter:
              emily.hall Emily Hall
              Participants:
              Last commenter:
              Jonathan Dahl
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                3 years, 2 weeks, 6 days ago
                Date of 1st Reply: