Permalink
Browse files

SERVER-7543 - don't over allocate extents, just round

  • Loading branch information...
1 parent b4b2c54 commit f9b92420fbf2107b050d41f3cb304ac285ed3be0 @erh erh committed Nov 2, 2012
Showing with 14 additions and 1 deletion.
  1. +11 −0 jstests/capped_server7543.js
  2. +3 −1 src/mongo/db/pdfile.cpp
@@ -0,0 +1,11 @@
+
+mydb = db.getSisterDB( "capped_server7543" );
+mydb.dropDatabase();
+
+mydb.createCollection( "foo" , { capped : true , size : 12288 } );
+
+assert.eq( 12288, mydb.foo.stats().storageSize );
+assert.eq( 1, mydb.foo.validate(true).extentCount );
+
+mydb.dropDatabase();
+
@@ -242,8 +242,10 @@ namespace mongo {
BSONElement e = options.getField("size");
if ( e.isNumber() ) {
size = e.numberLong();
- size += 256;
+ size += 0xff;
size &= 0xffffffffffffff00LL;
+ if ( size < Extent::minSize() )
+ size = Extent::minSize();
}
}

0 comments on commit f9b9242

Please sign in to comment.