diff options
author | Dwight <dmerriman@gmail.com> | 2008-06-12 16:19:29 -0400 |
---|---|---|
committer | Dwight <dmerriman@gmail.com> | 2008-06-12 16:19:29 -0400 |
commit | e0ac9757ac5c71187eea331f88d16e5bb1df2b90 (patch) | |
tree | bf676f44adcb19232dd5f935e8fc8263684176b6 | |
parent | c79a5e1753d25f261a059b33a172ea3534fd67f3 (diff) | |
download | mongo-e0ac9757ac5c71187eea331f88d16e5bb1df2b90.tar.gz |
extraneous loops assert
-rw-r--r-- | db/pdfile.cpp | 10 | ||||
-rw-r--r-- | db/pdfile.h | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/db/pdfile.cpp b/db/pdfile.cpp index ddf74adf615..017972e72f1 100644 --- a/db/pdfile.cpp +++ b/db/pdfile.cpp @@ -404,11 +404,13 @@ Extent* PhysicalDataFile::newExtent(const char *ns, int approxSize, int loops) { int ExtentSize = approxSize <= header->unusedLength ? approxSize : header->unusedLength; DiskLoc loc; if( ExtentSize <= 0 ) { - if( loops > 8 ) { - assert(false); - return 0; + /* not there could be a lot of looping here is db just started and + no files are open yet. we might want to do something about that. */ + if( loops > 8 ) { + assert( loops < 10000 ); + cout << "warning: loops=" << loops << " fileno:" << fileNo << ' ' << ns << '\n'; } - cout << "INFO: newExtent(): file full, adding a new file " << ns << endl; + cout << "info: newExtent(): file " << fileNo << " full, adding a new file " << ns << endl; return client->addAFile()->newExtent(ns, approxSize, loops+1); } int offset = header->unused.getOfs(); diff --git a/db/pdfile.h b/db/pdfile.h index ec8b07074c4..da7efbfc374 100644 --- a/db/pdfile.h +++ b/db/pdfile.h @@ -364,9 +364,9 @@ public: PhysicalDataFile* getFile(int n) { assert(this); - if( n < 0 || n >= 10000 ) { + if( n < 0 || n >= 8000 ) { cout << "getFile(): n=" << n << endl; - assert( n >= 0 && n < 10000 ); + assert( n >= 0 && n < 8000 ); } #if defined(_DEBUG) if( n > 100 ) |