diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-02-20 16:40:19 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-02-20 16:40:19 -0500 |
commit | d95fa41f505267d179d335588a2c5ebe3a190e45 (patch) | |
tree | 377c37c69fb26ed796923d8e03c4a1d66989a58f | |
parent | e987a94c7c396cc2a15e6033aa9d0f65a717421a (diff) | |
download | mongo-d95fa41f505267d179d335588a2c5ebe3a190e45.tar.gz |
handle oplog case where mixed working set may require much oplog scanning SERVER-649
Conflicts:
db/namespace.cpp
-rw-r--r-- | db/namespace.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/db/namespace.cpp b/db/namespace.cpp index 7ae46a348e1..dc8f13ee93f 100644 --- a/db/namespace.cpp +++ b/db/namespace.cpp @@ -445,9 +445,10 @@ namespace mongo { // signal done allocating new extents. if ( !deletedList[ 1 ].isValid() ) deletedList[ 1 ] = DiskLoc(); - + assert( len < 400000000 ); int passes = 0; + const int maxPasses = len / 30; // 30 is about the smallest entry that could go in the oplog DiskLoc loc; // delete records until we have room and the max # objects limit achieved. @@ -496,10 +497,10 @@ namespace mongo { DiskLoc fr = theCapExtent()->firstRecord; theDataFileMgr.deleteRecord(ns, fr.rec(), fr, true); compact(); - if( ++passes >= 5000 ) { - log() << "passes ns:" << ns << " len:" << len << '\n'; + if( ++passes >= maxPasses ) { + log() << "passes ns:" << ns << " len:" << len << " maxPasses: " << maxPasses << '\n'; log() << "passes max:" << max << " nrecords:" << nrecords << " datasize: " << datasize << endl; - massert( "passes >= 5000 in capped collection alloc", false ); + massert( "passes >= maxPasses in capped collection alloc", false ); } } |