From a5a781593683909e1c3024d7a07212d365282f8e Mon Sep 17 00:00:00 2001 From: Dwight Date: Thu, 21 Jan 2010 13:40:18 -0500 Subject: inspect NamespaceDetails on load --- db/db.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'db/db.cpp') 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() { -- cgit v1.2.1