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

PowerOf2 sizes can allow a document to grow in size inside a Capped Collection

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.4.0-rc2
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • ALL

      It should not be possible for a document to grow in size inside a capped collection. If usePowerOf2Sizes is set to true then documents can grow inside a Capped Collection

      // Can grow the document with usePowerOf2Sizes
      db.qwerty.drop()
      db.createCollection("qwerty", {capped:true, size:100000})
      db.runCommand( {collMod: "qwerty", usePowerOf2Sizes : true })
      db.qwerty.insert({"test":"onetwothreefourfive", "foo" : "bar"})
      db.qwerty.insert({"test":"fivesixseveneight", "foo" : "bar"})
      db.qwerty.update({"test":"onetwothreefourfive", "foo" : "bar"}, {"test":"onetwothreefourfive", "foo" : "bar", "qwerty":"dvorak"})
      db.qwerty.find()
      
      // Can't grow the document without usePowerOf2Sizes
      db.qwerty.drop()
      db.createCollection("qwerty", {capped:true, size:100000})
      db.qwerty.insert({"test":"onetwothreefourfive", "foo" : "bar"})
      db.qwerty.insert({"test":"fivesixseveneight", "foo" : "bar"})
      db.qwerty.update({"test":"onetwothreefourfive", "foo" : "bar"}, {"test":"onetwothreefourfive", "foo" : "bar", "qwerty":"dvorak"})
      db.qwerty.find()
      

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            andre.defrere@mongodb.com Andre de Frere
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: