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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 2.7.1
    • Fix Version/s: None
    • Component/s: Performance, Storage
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      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

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: