summaryrefslogtreecommitdiff
path: root/db/storage.cpp
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2009-02-04 11:26:59 -0500
committerDwight <dmerriman@gmail.com>2009-02-04 11:26:59 -0500
commit57af77dccf1399524876d3f6e98fb838255534c7 (patch)
tree1fc5b34c38cc2b2d1f5081205bc6a56349aac9c8 /db/storage.cpp
parentc01b4a773a45d7b7562db2334218cd64944b7396 (diff)
parent88daf0c1c83ed4ffa249deeb52b411d7997f9f4c (diff)
downloadmongo-57af77dccf1399524876d3f6e98fb838255534c7.tar.gz
Merge branch 'master' of git.10gen.com:/data/gitroot/p
Diffstat (limited to 'db/storage.cpp')
-rw-r--r--db/storage.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/db/storage.cpp b/db/storage.cpp
index 8793f7b6090..da4901ea242 100644
--- a/db/storage.cpp
+++ b/db/storage.cpp
@@ -21,8 +21,9 @@ static void storeThread() {
}
}
+// Currently only called on program exit.
void recCacheCloseAll() {
- BasicCached_RecStore::rc.writeDirty();
+ BasicCached_RecStore::rc.writeDirty( true );
RecCache::tempStore.flush();
}
@@ -73,7 +74,7 @@ inline void RecCache::writeIfDirty(Node *n) {
}
/* note that this is written in order, as much as possible, given that dirtyl is of type set. */
-void RecCache::writeDirty() {
+void RecCache::writeDirty( bool rawLog ) {
try {
for( set<DiskLoc>::iterator i = dirtyl.begin(); i != dirtyl.end(); i++ ) {
map<DiskLoc, Node*>::iterator j = m.find(*i);
@@ -82,7 +83,11 @@ void RecCache::writeDirty() {
}
}
catch(...) {
- log() << "Problem: bad() in RecCache::writeDirty, file io error\n";
+ const char *message = "Problem: bad() in RecCache::writeDirty, file io error\n";
+ if ( rawLog )
+ rawOut( message );
+ else
+ ( log() << message ).flush();
}
dirtyl.clear();
}