[SERVER-2818] Creating too large of a collection leads to file allocation failure exception that it cannot recover from Created: 22/Mar/11  Updated: 06/Dec/22  Resolved: 14/Sep/18

Status: Closed
Project: Core Server
Component/s: MMAPv1, Storage
Affects Version/s: 1.6.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Justin Smestad Assignee: Backlog - Storage Execution Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-3570 allocation failure creating collectio... Closed
Assigned Teams:
Storage Execution
Operating System: ALL
Participants:

 Description   

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.



 Comments   
Comment by Tanzeel ur Rehman [ 15/Oct/17 ]

has anyone looked into this issue ?

MongoError: exception: new file allocation failure
0|parse-wr |     at Function.MongoError.create (/usr/lib/node_modules/parse-server/node_modules/mongodb-core/lib/error.js:31:11)
0|parse-wr |     at /usr/lib/node_modules/parse-server/node_modules/mongodb-core/lib/connection/pool.js:497:72
0|parse-wr |     at authenticateStragglers (/usr/lib/node_modules/parse-server/node_modules/mongodb-core/lib/connection/pool.js:443:16)
0|parse-wr |     at null.messageHandler (/usr/lib/node_modules/parse-server/node_modules/mongodb-core/lib/connection/pool.js:477:5)
0|parse-wr |     at Socket.<anonymous> (/usr/lib/node_modules/parse-server/node_modules/mongodb-core/lib/connection/connection.js:331:22)
0|parse-wr |     at emitOne (events.js:90:13)
0|parse-wr |     at Socket.emit (events.js:182:7)
0|parse-wr |     at readableAddChunk (_stream_readable.js:153:18)
0|parse-wr |     at Socket.Readable.push (_stream_readable.js:111:10)
0|parse-wr |     at TCP.onread (net.js:534:20)

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