Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-5602

Insert on capped collection fails silently when too large

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Minor Change
    • ALL

      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
      }
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: