[SERVER-2806] fix finalize error message WAS: Database/table creation does not work from getSisterDB in sharded map/reduce (should assert?) Created: 21/Mar/11 Updated: 19/Mar/13 Resolved: 11/Mar/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code, JavaScript, MapReduce, Sharding |
| Affects Version/s: | 1.8.0-rc2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Alan Milford | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | Linux |
| Participants: |
| Description |
|
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"); return value; In this instance the new_db database is created, but is completely inaccessible and produces inconsistent errors: > db.getCollectionNames(); > db.repairDatabase(); > db.repairDatabase(); The database also cannot be dropped: > db.dropDatabase(); |
| Comments |
| Comment by Andy Schwerin [ 11/Mar/13 ] |
|
As of 2.4.0, the "db" object is not even available in map, reduce and finalize methods, to further emphasize that this is not allowed behavior. |
| Comment by Eliot Horowitz (Inactive) [ 22/Mar/11 ] |
|
Your'e not supposed to write to a db from a finalize at all. |