[SERVER-8408] mongodump dumps a collection with capped in metadata when it's not (anymore) Created: 30/Jan/13  Updated: 31/Jan/13  Resolved: 31/Jan/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.2.2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Taneli Leppä Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux 2.6.32-279.14.1.el6.x86_64 #1 SMP


Issue Links:
Duplicate
duplicates SERVER-6947 db.createCollection creates undefined... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Simple instructions:

# mongo
MongoDB shell version: 2.2.2
connecting to: test
> db.createCollection('test', { capped: true, size: 100000 });
{ "ok" : 1 }
> db.test.isCapped()
true
 
# mongodump --db test -c test
connected to: 127.0.0.1
Wed Jan 30 12:44:26 DATABASE: test	 to 	dump/test
Wed Jan 30 12:44:26 	test.test to dump/test/test.bson
Wed Jan 30 12:44:26 		 0 objects
Wed Jan 30 12:44:26 	Metadata for test.test to dump/test/test.metadata.json
 
# cat dump/test/test.metadata.json 
{ "options" : { "create" : "test", "capped" : true, "size" : 100000 }, "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "test.test", "name" : "_id_" } ] }
 
# mongo
MongoDB shell version: 2.2.2
connecting to: test
> db.test.drop()
true
> db.createCollection('test')
{ "ok" : 1 }
> db.test.isCapped()
false
 
# rm -rf dump
# mongodump --db test -c test
connected to: 127.0.0.1
Wed Jan 30 12:45:33 DATABASE: test	 to 	dump/test
Wed Jan 30 12:45:33 	test.test to dump/test/test.bson
Wed Jan 30 12:45:33 		 0 objects
Wed Jan 30 12:45:33 	Metadata for test.test to dump/test/test.metadata.json
 
# cat dump/test/test.metadata.json 
{ "options" : { "create" : "test", "capped" : { "$undefined" : true }, "size" : { "$undefined" : true } }, "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "test.test", "name" : "_id_" } ] }

Participants:

 Description   

Mongodump seems to dump a collection with capped metadata in collection.metadata.json. The collection was previously capped, but was dropped and recreated as uncapped. This will cause an error when mongorestoring the collection.



 Comments   
Comment by Taneli Leppä [ 30/Jan/13 ]

My bug seems to be duplicate of SERVER-6947.

Comment by Taneli Leppä [ 30/Jan/13 ]

Nevermind, this seems to be happen even for collections that were never capped... my bad.

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