0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00

alloc() bug fix

This commit is contained in:
Dwight 2009-08-24 16:43:33 -04:00
parent 9c1d0e2313
commit 6c4a830e21

View File

@ -1283,11 +1283,12 @@ assert( !eloc.isNull() );
// out of space
if ( d->capped == 0 ) { // size capped doesn't grow
log(1) << "allocating new extent for " << ns << " padding:" << d->paddingFactor << " lenWHdr: " << lenWHdr << endl;
database->newestFile()->allocExtent(ns, followupExtentSize(len, d->lastExtentSize));
database->newestFile()->allocExtent(ns, followupExtentSize(lenWHdr, d->lastExtentSize));
loc = d->alloc(ns, lenWHdr, extentLoc);
if ( loc.isNull() ){
log() << " alloc failed after allocating new extent. lenWHdr: " << lenWHdr << " last extent size:" << d->lastExtentSize << " trying again" << endl;
log() << "WARNING: alloc() failed after allocating new extent. lenWHdr: " << lenWHdr << " last extent size:" << d->lastExtentSize << "; trying again\n";
for ( int zzz=0; zzz<10 && lenWHdr > d->lastExtentSize; zzz++ ){
log() << "try #" << zzz << endl;
database->newestFile()->allocExtent(ns, followupExtentSize(len, d->lastExtentSize));
loc = d->alloc(ns, lenWHdr, extentLoc);
if ( ! loc.isNull() )