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

XMLWordPrintableJSON

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

      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 Horowitz (Inactive)
              Reporter:
              Andre de Frere
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: