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

Comment on: "manual/reference/config-database"

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None

    Description

      From what I can see from my Mongo 3.4 install, this line is incorrect:

      When a databases have sharding enabled, the primary field holds the name of the primary shard.

      The "primary" field contains the a shard name whether or not sharding is enabled for the database. The only reliable way to check if sharding is enabled is if the "partitioned" field has a value of true (as documented in https://docs.mongodb.com/manual/tutorial/view-sharded-cluster-configuration/).

      For example:

      mongos> db.databases.find()
      { "_id" : "db1", "primary" : "rs_prod_shard1", "partitioned" : true }
      { "_id" : "db2", "primary" : "rs_prod_shard1", "partitioned" : false }
      

      Note, for the "db2" database, the "primary" field has a value, yet the "partitioned" field is false.

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            ips Ian Springer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              4 years, 20 weeks ago