[SERVER-5602] Insert on capped collection fails silently when too large Created: 13/Apr/12  Updated: 14/May/14  Resolved: 15/Apr/12

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

Type: Bug Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-2639 Inserting into a capped collection an... Closed
Backwards Compatibility: Minor Change
Operating System: ALL
Participants:

 Description   

When inserting a document larger than the allocated extents all existing docs are deleted but no error is generated.

> db.createCollection("capped_20b", {capped:true, size:20})
{ "ok" : 1 }
> db.capped_20b.insert({_id:1, text:"test"})
> db.capped_20b.stats( )
{
        "ns" : "test.capped_20b",
        "count" : 1,
        "size" : 36,
        "avgObjSize" : 36,
        "storageSize" : 4096,
        "numExtents" : 1,
        "nindexes" : 0,
        "lastExtentSize" : 4096,
        "paddingFactor" : 1,
        "flags" : 0,
        "totalIndexSize" : 0,
        "indexSizes" : {
 
        },
        "capped" : 1,
        "max" : 2147483647,
        "ok" : 1
}
> db.capped_20b.insert({_id:1, text:5KChar_String}) //5K character string insert
> db.capped_20b.stats( )
{
        "ns" : "test.capped_20b",
        "count" : 0,
        "size" : 0,
        "storageSize" : 4096,
        "numExtents" : 1,
        "nindexes" : 0,
        "lastExtentSize" : 4096,
        "paddingFactor" : 1,
        "flags" : 0,
        "totalIndexSize" : 0,
        "indexSizes" : {
 
        },
        "capped" : 1,
        "max" : 2147483647,
        "ok" : 1
}



 Comments   
Comment by Eliot Horowitz (Inactive) [ 15/Apr/12 ]

SERVER-2639

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