[SERVER-3539] mongos returns duplicate "ns" element when you run db.xyz.stats() Created: 05/Aug/11  Updated: 12/Jul/16  Resolved: 08/Aug/11

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 1.8.2
Fix Version/s: 1.9.2

Type: Bug Priority: Minor - P4
Reporter: Robert Stam Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

When you run db.xyz.stats() via mongos it returns duplicate "ns" element. In my test the xyz collection itself was not sharded. Here's the output I got:

> var st = new ShardingTest("stest", 2, 0, 3);
> var mongos = st.s;
> var sdb = mongos.getDB("test")
> sdb.test.insert(

{x:1}

) // make sure collection exists
> sdb.test.stats()
{
"ns" : "test.test",
"sharded" : false,
"primary" : "shard0001",
"ns" : "test.test", // <=== duplicate "ns" element
"count" : 1,
"size" : 36,
"avgObjSize" : 36,
"storageSize" : 2048,
"numExtents" : 1,
"nindexes" : 1,
"lastExtentSize" : 2048,
"paddingFactor" : 1,
"flags" : 1,
"totalIndexSize" : 8192,
"indexSizes" :

{ "_id_" : 8192 }

,
"ok" : 1
}



 Comments   
Comment by Alan Shang [ 14/Oct/11 ]

Please fix this in 1.8 as well since this breaks the tools like MongoVUE. The vast majority of production deployment is still older than 2.0, so back porting is important.

Comment by auto [ 08/Aug/11 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: don't duplicate ns entry for non-sharded collections via mongos SERVER-3539
Branch: master
https://github.com/mongodb/mongo/commit/690505dee9f6b6f56e0c81fd1da27e45dda1f711

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