summaryrefslogtreecommitdiff
path: root/db/dur_journal.cpp
diff options
context:
space:
mode:
authorDwight <dwight@10gen.com>2011-03-07 15:28:36 -0500
committerDwight <dwight@10gen.com>2011-03-07 15:28:36 -0500
commite6d2aa60e513d0cc85668444cc7348bb17cfa2f6 (patch)
tree02ab32b89e108604c7e4e7ff32fce92f8ea3c854 /db/dur_journal.cpp
parentfd7c3574030467116c8ff44f84f5d21a629d62b5 (diff)
downloadmongo-e6d2aa60e513d0cc85668444cc7348bb17cfa2f6.tar.gz
more conservative preallocateIsFaster check
Diffstat (limited to 'db/dur_journal.cpp')
-rw-r--r--db/dur_journal.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/db/dur_journal.cpp b/db/dur_journal.cpp
index a3a2a493192..cfed2191f75 100644
--- a/db/dur_journal.cpp
+++ b/db/dur_journal.cpp
@@ -240,7 +240,13 @@ namespace mongo {
}
bool preallocateIsFaster() {
Timer t;
- bool res = _preallocateIsFaster() && _preallocateIsFaster() && _preallocateIsFaster();
+ bool res = false;
+ if( _preallocateIsFaster() && _preallocateIsFaster() ) {
+ // maybe system is just super busy at the moment? sleep a second to let it calm down.
+ // deciding to to prealloc is a medium big decision:
+ sleepsecs(1);
+ res = _preallocateIsFaster();
+ }
if( t.millis() > 3000 )
log() << "preallocateIsFaster check took " << t.millis()/1000.0 << " secs" << endl;
return res;