-
Type:
Bug
-
Resolution: Done
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 1.8.0-rc2
-
Component/s: Internal Code, JavaScript, MapReduce, Sharding
-
None
-
Linux
-
None
-
0
-
None
-
None
-
None
-
None
-
None
-
None
When running a map/reduce on a sharded collection with a finalize() function, cross-database creation does not work (or assert):
Finalize example (assuming new_db does not yet exist):
finalize = function (key, value) {
var new_db = db.getSisterDB("new_db");
stat = value;
stat._id = key;
new_db.table.save(stat);
return value;
};
In this instance the new_db database is created, but is completely inaccessible and produces inconsistent errors:
> db.getCollectionNames();
Mon Mar 21 15:15:04 uncaught exception: error:
> db.repairDatabase();
Mon Mar 21 15:09:00 uncaught exception: error
> db.repairDatabase();
{
"assertion" : "no primary shard configured for db: new_db",
"assertionCode" : 8041,
"errmsg" : "db assertion failure",
"ok" : 0
}
The database also cannot be dropped:
> db.dropDatabase();
{
"assertion" : "assertion client/../s/shard.h:80",
"errmsg" : "db assertion failure",
"ok" : 0
}