summaryrefslogtreecommitdiff
path: root/db/db.cpp
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2010-01-21 13:40:18 -0500
committerDwight <dmerriman@gmail.com>2010-01-21 13:40:18 -0500
commita5a781593683909e1c3024d7a07212d365282f8e (patch)
treee52de46b1b49ee106b98fbc88a32c2807d99081b /db/db.cpp
parent3f09bd4f64827e3491d34f866a2cf3e5325f188f (diff)
downloadmongo-a5a781593683909e1c3024d7a07212d365282f8e.tar.gz
inspect NamespaceDetails on load
Diffstat (limited to 'db/db.cpp')
-rw-r--r--db/db.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/db/db.cpp b/db/db.cpp
index 582f0ddf3e6..851ce11f0d8 100644
--- a/db/db.cpp
+++ b/db/db.cpp
@@ -332,8 +332,14 @@ namespace mongo {
return repairDatabase( dbName.c_str(), errmsg );
}
+ extern bool checkNsFilesOnLoad;
+
void repairDatabases() {
log(1) << "enter repairDatabases" << endl;
+
+ assert(checkNsFilesOnLoad);
+ checkNsFilesOnLoad = false; // we are mainly just checking the header - don't scan the whole .ns file for every db here.
+
dblock lk;
vector< string > dbNames;
getDatabaseNames( dbNames );
@@ -374,6 +380,8 @@ namespace mongo {
cc().shutdown();
dbexit( EXIT_CLEAN );
}
+
+ checkNsFilesOnLoad = true;
}
void clearTmpFiles() {