[SERVER-14237] The "size" parameter for non-capped collections stopped being honored in HEAD Created: 12/Jun/14  Updated: 10/Dec/14  Resolved: 12/Jun/14

Status: Closed
Project: Core Server
Component/s: Performance, Storage
Affects Version/s: 2.7.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: PHO Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-13144 Size value is ignored when creating n... Closed
Related
is related to DOCS-3580 db.createCollection() size parameter ... Closed
Operating System: ALL
Steps To Reproduce:

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

Participants:
PHO

 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.



 Comments   
Comment by PHO [ 12/Jun/14 ]

Opened a pull request:
https://github.com/mongodb/mongo/pull/695

Generated at Thu Feb 08 03:34:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.