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

WiredTiger allows capped collection objects to grow

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.0.2
    • Fix Version/s: 3.2.0-rc0
    • Component/s: Storage, WiredTiger
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change
    • Operating System:
      ALL
    • Sprint:
      QuInt A (10/12/15)

      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

              • Votes:
                0 Vote for this issue
                Watchers:
                16 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: