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

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

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.7.1
    • Component/s: 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);

      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.

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

              Created:
              Updated:
              Resolved: