Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-8961

WiredTiger allows capped collection objects to grow

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Needs Triage
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Server
    • Labels:
      None

      Description

      In MMAP items in a capped collection cannot grow - as per the documentation and an error is raised if they do.

      > db.createCollection("cap",{capped:true,size:128000})
      { "ok" : 1 }
      >  db.cap.update({_id:1},{$set:{test:"hello",vals:["one"]}},true,true)
      WriteResult({ "nMatched" : 0, "nUpserted" : 1, "nModified" : 0, "_id" : 1 })
      >  db.cap.update({_id:1},{$set:{test:"hello"},$push:{vals:"two"}},true,true)
      WriteResult({
      	"nMatched" : 0,
      	"nUpserted" : 0,
      	"nModified" : 0,
      	"writeError" : {
      		"code" : 10003,
      		"errmsg" : "failing update: objects in a capped ns cannot grow"
      	}
      })
      

      In WiredTiger they are allowed to grow - is this deliberate?

      > db.createCollection("cap",{capped:true,size:128000})
      { "ok" : 1 }
      > db.cap.update({_id:1},{$set:{test:"hello",vals:["one"]}},true,true)
      WriteResult({ "nMatched" : 0, "nUpserted" : 1, "nModified" : 0, "_id" : 1 })
      > db.cap.findOne()
      { "_id" : 1, "test" : "hello", "vals" : [ "one" ] }
      > db.cap.update({_id:1},{$set:{test:"hello"},$push:{vals:"two"}},true,true)
      WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
      > db.cap.findOne()
      { "_id" : 1, "test" : "hello", "vals" : [ "one", "two" ] }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              emily.hall Emily Hall
              Participants:
              Last commenter:
              Anthony Sansone Anthony Sansone
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Days since reply:
                4 years, 37 weeks, 5 days ago