Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8117

listDatabases should always get config/admin dbstats from config servers

    • ALL

      Currently the config db stats are only retrieved from the config db servers if there is no config db on any shard which produces unexpected results, esp. relative to the databases mapping.

      >var sh = new ShardingTest({shards:1, mongos:1, other : { separateConfig : true}})
      >sh.s0.adminCommand("listDatabases")
      {
        "databases" : [
      		{
      			"name" : "config",
      			"empty" : false,
      			"sizeOnDisk" : 50331648
      		}
      	],
      	"totalSize" : 0,
      	"totalSizeMb" : 0,
      	"ok" : 1
      }
      >sh.d0.getDB("config").stats()
      {
      	"db" : "config",
      	"collections" : 0,
      	"objects" : 0,
      	"avgObjSize" : 0,
      	"dataSize" : 0,
      	"storageSize" : 0,
      	"numExtents" : 0,
      	"indexes" : 0,
      	"indexSize" : 0,
      	"fileSize" : 0,
      	"nsSizeMB" : 0,
      	"ok" : 1
      }
      > sh.s0.adminCommand("listDatabases")
      {
      	"databases" : [
      		{
      			"name" : "config",
      			"sizeOnDisk" : 1,
      			"empty" : true,
      			"shards" : {
      				"shard0000" : 1
      			}
      		}
      	],
      	"totalSize" : 1,
      	"totalSizeMb" : 0,
      	"ok" : 1
      }
      

      Also, the config/admin/etc dbs should be added to the totals as well.

            Assignee:
            scotthernandez Scott Hernandez (Inactive)
            Reporter:
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: