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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 2.4.0-rc2
    • Storage
    • None
    • ALL

    Description

      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()

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: