If the drive only has 20GB and you try to create a 40GB capped collection, for example, named 'people', MongoDB will fail with the following error:
{
"errmsg" : "exception: file allocation failure",
"code" : 12520,
"ok" : 0
}
However the disk space is never cleaned up. So I cannot go back in and say allocate a 18GB capped collection now that I know it was too large. MongoDB should 'undo' on this sort of file allocation error so you can correct the information without running db.repairDatabase(). Also the system.namespaces collection thinks the database was created so your unable to reuse the same name (even though the attempt failed) and I cannot call db.people.drop() as it says it doesnt exist.
You end up with a very inconsistant state where it is unclear what it would end up with even after running repairDatabase or validate.
- is related to
-
SERVER-3570 allocation failure creating collection leads to inconsistent state
- Closed