[SERVER-8117] listDatabases should always get config/admin dbstats from config servers Created: 09/Jan/13  Updated: 11/Jul/16  Resolved: 22/Jan/13

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.0.8, 2.2.2, 2.4.0-rc0
Fix Version/s: 2.2.3, 2.4.0-rc0

Type: Bug Priority: Critical - P2
Reporter: Scott Hernandez (Inactive) Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 1
Labels: commands, listDatabases, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-4026 size of config database on shard repo... Closed
Related
Operating System: ALL
Participants:

 Description   

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.



 Comments   
Comment by auto [ 23/Jan/13 ]

Author:

{u'date': u'2013-01-22T18:53:52Z', u'email': u'scotthernandez@gmail.com', u'name': u'Scott Hernandez'}

Message: SERVER-8117: listDatabases - config/admin db should come from config servers
Branch: v2.2
https://github.com/mongodb/mongo/commit/ededb03f2104f37cdb376e0f17a4d53b87f05cdf

Comment by auto [ 22/Jan/13 ]

Author:

{u'date': u'2013-01-22T18:53:52Z', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}

Message: SERVER-8117: listDatabases - config/admin db should come from config servers
Branch: master
https://github.com/mongodb/mongo/commit/c3cbef09e99892c1d559f3275183f040501f6ddd

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