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

The "size" parameter for non-capped collections stopped being honored in HEAD

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 2.7.1
    • Performance, Storage
    • None
    • ALL
    • Hide

      var sz = 1 * 1024 * 1024; // 1 MiB
      db.createCollection("foo", {size: sz});
       
      var stats = db.foo.stats();
      assert.gte(stats.storageSize, sz);

      Show
      var sz = 1 * 1024 * 1024; // 1 MiB db.createCollection( "foo" , {size: sz});   var stats = db.foo.stats(); assert.gte(stats.storageSize, sz);

    Description

      The documentation for db.createCollection states the following for the size parameter:

      If capped is false, you can use this field to preallocate space for an ordinary collection.

      This was true prior to r2.7.1 but the size parameter gets silently ignored in HEAD when the collection to be created is not capped. It was the only (documented) way not to allocate a lot of extents for a collection that was supposed to grow to a large size, say 500 MiB.

      I have a patch to resurrect this feature. I'll send a pull request after submitting this issue.

      Attachments

        Activity

          People

            Unassigned Unassigned
            pho PHO
            PHO
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: