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

Size value is ignored when creating non-capped collections

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 2.6.0-rc1
    • Fix Version/s: None
    • Component/s: Storage
    • Labels:
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      var myDB = db.getSiblingDB('repro');
      myDB.dropDatabase();
      myDB.createCollection('sizetest', {size: 10000000});
      myDB.sizetest.stats();

      Show
      var myDB = db.getSiblingDB('repro'); myDB.dropDatabase(); myDB.createCollection('sizetest', {size: 10000000}); myDB.sizetest.stats();

      Description

      In 2.4.9, if you specified a 'size' value for a non-capped collection, the storage space was pre-allocated. In master, the size value is no longer honored for non-capped collections. This is a regression caused by the changes from SERVER-8412.

      2.4.9:

      > var myDB = db.getSiblingDB('repro');
      > myDB.dropDatabase();
      { "dropped" : "repro", "ok" : 1 }
      > myDB.createCollection('sizetest', {size: 10000000});
      { "ok" : 1 }
      > myDB.sizetest.stats();
      {
      	"ns" : "repro.sizetest",
      	"count" : 0,
      	"size" : 0,
      	"storageSize" : 10002432,
      	"numExtents" : 1,
      	"nindexes" : 1,
      	"lastExtentSize" : 10002432,
      	"paddingFactor" : 1,
      	"systemFlags" : 1,
      	"userFlags" : 0,
      	"totalIndexSize" : 8176,
      	"indexSizes" : {
      		"_id_" : 8176
      	},
      	"ok" : 1
      }

      master:

      > var myDB = db.getSiblingDB('repro');
      > myDB.dropDatabase();
      { "dropped" : "repro", "ok" : 1 }
      > myDB.createCollection('sizetest', {size: 10000000});
      { "ok" : 1 }
      > myDB.sizetest.stats()
      {
      	"ns" : "repro.sizetest",
      	"count" : 0,
      	"size" : 0,
      	"storageSize" : 8192,
      	"numExtents" : 1,
      	"nindexes" : 1,
      	"lastExtentSize" : 8192,
      	"paddingFactor" : 1,
      	"systemFlags" : 1,
      	"userFlags" : 1,
      	"totalIndexSize" : 8176,
      	"indexSizes" : {
      		"_id_" : 8176
      	},
      	"ok" : 1
      }


      Version: 575c9cbe27ba6b9ba56b810e42508d120ae44a94

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: