In 2.6 and master, inserting a document that's almost as large as the entire capped collection results in a 'no space in capped collection' error. There are two potential issues with this:
- The status message uses ErrorCodes::InternalError, which makes me think this scenario shouldn't be easily triggered by user input.
- The error message is slightly misleading because the capped collection actually does have some space in it. 'no space' implies that the collection is full even though it might be completely empty.
Output from master:
> var myDB = db.getSiblingDB('anotherdb'); > myDB.dropDatabase(); { "dropped" : "anotherdb", "ok" : 1 } > myDB.createCollection('foo', {capped: true, size: 8192, usePowerOf2Sizes: false}); { "ok" : 1 } > myDB.foo.insert({ a: new Array(8000).join('a') }); WriteResult({ "nInserted" : 0, "writeError" : { "code" : 1, "errmsg" : "no space in capped collection" } }) > myDB.foo.insert({ a: new Array(8200).join('a') }); WriteResult({ "nInserted" : 0, "writeError" : { "code" : 2, "errmsg" : "document is larger than capped size 8248 > 8192" } })
Version: ce04ab3728edeff71f0c32590558cb980a07fdb3
- is related to
-
SERVER-6981 maxPasses assertion (on allocation failure) can make capped collection unreadable
- Closed