Every database has a system.namespaces collection. Note that there is no "systems" collection, the actual name of the collection is "system.namespaces". Please try running db.system.namespaces.find()
> Every database has a system.namespaces collection. Note that there is no > "systems" collection, the actual name of the collection is > "system.namespaces". Please try running db.system.namespaces.find()
> On Thursday, September 6, 2012 3:55:03 AM UTC-4, Thomas wrote:
>> I don't have any namespaces in the system collection ...
>> Le mercredi 5 septembre 2012 23:03:35 UTC+2, Mathias Stearn a écrit :
>>> What does db.system.namespaces.find() say?
>>> On Wednesday, September 5, 2012 10:21:54 AM UTC-4, Thomas wrote:
>>>> Hello,
>>>> I have a big backup issue with mongo 2.2 under ubuntu 12.04.
>>>> When I backup my whole database (mongodump on the db) it badly exports >>>> some of my collections (the metadata contains undefined values)
>>>> Exemple:
>>>> > db.testairq.stats()
>>>> {
>>>> "ns" : "test.testairq",
>>>> "count" : 0,
>>>> "size" : 0,
>>>> "storageSize" : 5713248256,
>>>> "numExtents" : 32,
>>>> "nindexes" : 1,
>>>> "lastExtentSize" : 961069056,
>>>> "paddingFactor" : 1.5299999998863023,
>>>> "systemFlags" : 0,
>>>> "userFlags" : 0,
>>>> "totalIndexSize" : 8176,
>>>> "indexSizes" : {
>>>> "_id.loc___id.time_1" : 8176
>>>> },
>>>> "ok" : 1
>>>> }
>>>> Is this a known bug or do I have to open a new issue ?
>>>> It's really a big issue since my backup system is totally based on this >>>> mechanism.
On Friday, September 7, 2012 1:30:55 PM UTC-4, Thomas wrote:
> Indeed (i just thought that, because the completion on the console did not > work for namespaces) :)
> Well for the collection message_queue i have this metadata genrated by > mongodump:
> {options : { "create" : "message_queue", "capped" : true, "size" : 1024, > undefined }, indexes:[{ "v" : 1, "key" : { "time" : 1 }, "unique" : true, > "ns" : "nadb.message_queue", "sparse" : true, "name" : "time_1" }]}
> And in the db.system.namespaces.find() : (for our message_queue part only)
> { "name" : "nadb.message_queue", "options" : { "create" : "message_queue", > "capped" : true, "size" : 1024, "max" : null } }
> { "name" : "nadb.message_queue.$time_1" }
> Le vendredi 7 septembre 2012 19:18:35 UTC+2, Mathias Stearn a écrit :
>> Every database has a system.namespaces collection. Note that there is no >> "systems" collection, the actual name of the collection is >> "system.namespaces". Please try running db.system.namespaces.find()
>> On Thursday, September 6, 2012 3:55:03 AM UTC-4, Thomas wrote:
>>> I don't have any namespaces in the system collection ...
>>> Le mercredi 5 septembre 2012 23:03:35 UTC+2, Mathias Stearn a écrit :
>>>> What does db.system.namespaces.find() say?
>>>> On Wednesday, September 5, 2012 10:21:54 AM UTC-4, Thomas wrote:
>>>>> Hello,
>>>>> I have a big backup issue with mongo 2.2 under ubuntu 12.04.
>>>>> When I backup my whole database (mongodump on the db) it badly exports >>>>> some of my collections (the metadata contains undefined values)
>>>>> Exemple:
>>>>> > db.testairq.stats()
>>>>> {
>>>>> "ns" : "test.testairq",
>>>>> "count" : 0,
>>>>> "size" : 0,
>>>>> "storageSize" : 5713248256,
>>>>> "numExtents" : 32,
>>>>> "nindexes" : 1,
>>>>> "lastExtentSize" : 961069056,
>>>>> "paddingFactor" : 1.5299999998863023,
>>>>> "systemFlags" : 0,
>>>>> "userFlags" : 0,
>>>>> "totalIndexSize" : 8176,
>>>>> "indexSizes" : {
>>>>> "_id.loc___id.time_1" : 8176
>>>>> },
>>>>> "ok" : 1
>>>>> }
>>>>> Is this a known bug or do I have to open a new issue ?
>>>>> It's really a big issue since my backup system is totally based on >>>>> this mechanism.
>> Le vendredi 7 septembre 2012 19:18:35 UTC+2, Mathias Stearn a écrit :
>>> Every database has a system.namespaces collection. Note that there is no >>> "systems" collection, the actual name of the collection is >>> "system.namespaces". Please try running db.system.namespaces.find()
>>> On Thursday, September 6, 2012 3:55:03 AM UTC-4, Thomas wrote:
>>>> I don't have any namespaces in the system collection ...
>>>> Le mercredi 5 septembre 2012 23:03:35 UTC+2, Mathias Stearn a écrit :
>>>>> What does db.system.namespaces.find() say?
>>>>> On Wednesday, September 5, 2012 10:21:54 AM UTC-4, Thomas wrote:
>>>>>> Hello,
>>>>>> I have a big backup issue with mongo 2.2 under ubuntu 12.04.
>>>>>> When I backup my whole database (mongodump on the db) it badly >>>>>> exports some of my collections (the metadata contains undefined values)
>>>>>> Exemple:
>>>>>> > db.testairq.stats()
>>>>>> {
>>>>>> "ns" : "test.testairq",
>>>>>> "count" : 0,
>>>>>> "size" : 0,
>>>>>> "storageSize" : 5713248256,
>>>>>> "numExtents" : 32,
>>>>>> "nindexes" : 1,
>>>>>> "lastExtentSize" : 961069056,
>>>>>> "paddingFactor" : 1.5299999998863023,
>>>>>> "systemFlags" : 0,
>>>>>> "userFlags" : 0,
>>>>>> "totalIndexSize" : 8176,
>>>>>> "indexSizes" : {
>>>>>> "_id.loc___id.time_1" : 8176
>>>>>> },
>>>>>> "ok" : 1
>>>>>> }
>>>>>> Is this a known bug or do I have to open a new issue ?
>>>>>> It's really a big issue since my backup system is totally based on >>>>>> this mechanism.
>> Le vendredi 7 septembre 2012 19:18:35 UTC+2, Mathias Stearn a écrit :
>>> Every database has a system.namespaces collection. Note that there is no >>> "systems" collection, the actual name of the collection is >>> "system.namespaces". Please try running db.system.namespaces.find()
>>> On Thursday, September 6, 2012 3:55:03 AM UTC-4, Thomas wrote:
>>>> I don't have any namespaces in the system collection ...
>>>> Le mercredi 5 septembre 2012 23:03:35 UTC+2, Mathias Stearn a écrit :
>>>>> What does db.system.namespaces.find() say?
>>>>> On Wednesday, September 5, 2012 10:21:54 AM UTC-4, Thomas wrote:
>>>>>> Hello,
>>>>>> I have a big backup issue with mongo 2.2 under ubuntu 12.04.
>>>>>> When I backup my whole database (mongodump on the db) it badly >>>>>> exports some of my collections (the metadata contains undefined values)
>>>>>> Exemple:
>>>>>> > db.testairq.stats()
>>>>>> {
>>>>>> "ns" : "test.testairq",
>>>>>> "count" : 0,
>>>>>> "size" : 0,
>>>>>> "storageSize" : 5713248256,
>>>>>> "numExtents" : 32,
>>>>>> "nindexes" : 1,
>>>>>> "lastExtentSize" : 961069056,
>>>>>> "paddingFactor" : 1.5299999998863023,
>>>>>> "systemFlags" : 0,
>>>>>> "userFlags" : 0,
>>>>>> "totalIndexSize" : 8176,
>>>>>> "indexSizes" : {
>>>>>> "_id.loc___id.time_1" : 8176
>>>>>> },
>>>>>> "ok" : 1
>>>>>> }
>>>>>> Is this a known bug or do I have to open a new issue ?
>>>>>> It's really a big issue since my backup system is totally based on >>>>>> this mechanism.
Unfortunately this is a bug in the mongodump code. When a collection is created with the command line it creates the collection with all the options for a capped table but the values are null. you can see this using db.system.namespaces.find():
The offending table should have and entry like above. There are a few ways to fix this. The easiest one I found is to do the following:
1. 'mongoexport -d mydatabase --collection mycollection > mycollection.json'
2. mongo cli 'db.mycolleciton.renameCollection("myoldcollection")
3. 'mongoimport -d mydatabase --collection mycollection --file mycollection.json
The result namespace entry will be
{ "name" : "mydatabase.mycollection"}
Of course, on an active collection, you may not have this opportunity. Really this is a band-aid anyway. The real fix should be in the mongodump code when it creates the metadata file. We can see the offender in https://github.com/mongodb/mongo/blob/master/src/mongo/tools/dump.cpp
string sns = db + ".system.namespaces";
cursor = conn( true ).query( sns.c_str() , Query() , 0 , 0 , 0 , QueryOption_SlaveOk | QueryOption_NoCursorTimeout );
while ( cursor->more() ) {
BSONObj obj = cursor->nextSafe();
const string name = obj.getField( "name" ).valuestr(); <-------------- line 197 name is null here.
if (obj.hasField("options")) {
collectionOptions[name] = obj.getField("options").embeddedObject().getOwned(); <----------------line 199 null name is undefined.
}
I am pretty sure a small fix here could resolve this issue going forward. If I had the time or the chops I would fix it. Hopefully there is someone who can take a look into this.
>>> Le vendredi 7 septembre 2012 19:18:35 UTC+2, Mathias Stearn a écrit :
>>>> Every database has a system.namespaces collection. Note that there is >>>> no "systems" collection, the actual name of the collection is >>>> "system.namespaces". Please try running db.system.namespaces.find()
>>>> On Thursday, September 6, 2012 3:55:03 AM UTC-4, Thomas wrote:
>>>>> I don't have any namespaces in the system collection ...
>>>>> Le mercredi 5 septembre 2012 23:03:35 UTC+2, Mathias Stearn a écrit :
>>>>>> What does db.system.namespaces.find() say?
>>>>>> On Wednesday, September 5, 2012 10:21:54 AM UTC-4, Thomas wrote:
>>>>>>> Hello,
>>>>>>> I have a big backup issue with mongo 2.2 under ubuntu 12.04.
>>>>>>> When I backup my whole database (mongodump on the db) it badly >>>>>>> exports some of my collections (the metadata contains undefined values)
>>>>>>> Exemple:
>>>>>>> > db.testairq.stats()
>>>>>>> {
>>>>>>> "ns" : "test.testairq",
>>>>>>> "count" : 0,
>>>>>>> "size" : 0,
>>>>>>> "storageSize" : 5713248256,
>>>>>>> "numExtents" : 32,
>>>>>>> "nindexes" : 1,
>>>>>>> "lastExtentSize" : 961069056,
>>>>>>> "paddingFactor" : 1.5299999998863023,
>>>>>>> "systemFlags" : 0,
>>>>>>> "userFlags" : 0,
>>>>>>> "totalIndexSize" : 8176,
>>>>>>> "indexSizes" : {
>>>>>>> "_id.loc___id.time_1" : 8176
>>>>>>> },
>>>>>>> "ok" : 1
>>>>>>> }
>>>>>>> Is this a known bug or do I have to open a new issue ?
>>>>>>> It's really a big issue since my backup system is totally based on >>>>>>> this mechanism.