ISSUE SUMMARY
Prior to version 2.4.4 (and 2.2.5 in the 2.2 cycle), a call to db.createCollection() would set certain collection options to a null value rather than omitting them if they were not explicitly set by the user (see SERVER-6947 for details). Version 2.4 of the server ignored these null values, but 2.6 fails with an error message upon encountering them. This may cause problems when making copies of collections using a 2.6 server; affected commands include cloneCollection and repairDatabase.
To verify if a collection is affected by this issue, inspect the system.namespaces collection of each database for any documents that have null values for options.size or options.max fields. Here is an example that shows an affected collection "test.foo":
> db.system.namespaces.find() { "name" : "test.system.indexes" } { "name" : "test.foo.$_id_" } { "name" : "test.foo", "options" : { "create" : "foo", "capped" : null, "size" : null } }
USER IMPACT
Operations that copy collections fail with an error message.
WORKAROUNDS
N/A
AFFECTED VERSIONS
MongoDB production releases 2.6.0 and 2.6.1 are affected by this issue.
FIX VERSION
The fix is included in the 2.6.2 production release.
RESOLUTION DETAILS
The procedure that parses collection options ignores values for size and max if they are non-numeric, rather than returning an error and aborting the command.
Original description
When attempting to clone collection from live at version 2.4.3 to dev at version 2.6.0 recieved error.
shard2:PRIMARY> db.runCommand(
{cloneCollection:"homescom_reporting.realmedia_campaign_daily_sum",from:"mongodb11.dc3.homes.com:27017"});
{ "ok" : 0, "errmsg" : "BadValue size has to be a number" }Is this a cross version issue or is there a problem cloneCollection in 2.6?
- is related to
-
SERVER-6947 db.createCollection creates undefined fields which cause mongorestore to fail
- Closed
-
SERVER-16293 repairDatabase causes "size has to be a number"
- Closed
- related to
-
SERVER-13927 Copydb breaks on (some) capped collections
- Closed
-
SERVER-13968 Report invalid collection options in "<db>.system.namespaces" in upgrade checker
- Closed