diff options
author | Kristina <kristina@10gen.com> | 2013-02-11 12:12:21 -0500 |
---|---|---|
committer | Kristina <kristina@10gen.com> | 2013-02-11 12:26:47 -0500 |
commit | 71440fea8bf12d12705830817fa1c1a7275ec041 (patch) | |
tree | fed1841e23dae78b9573320e31b69ece2c4776f4 /src | |
parent | 39d99f00e987d2164412800ea8dbc0894c899cd5 (diff) | |
download | mongo-71440fea8bf12d12705830817fa1c1a7275ec041.tar.gz |
SERVER-8344 Add log message about skipping index build retries
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/index_rebuilder.cpp | 10 | ||||
-rw-r--r-- | src/mongo/db/index_rebuilder.h | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/mongo/db/index_rebuilder.cpp b/src/mongo/db/index_rebuilder.cpp index b4459603df1..fd2426e48a1 100644 --- a/src/mongo/db/index_rebuilder.cpp +++ b/src/mongo/db/index_rebuilder.cpp @@ -47,19 +47,20 @@ namespace mongo { Client::GodScope gs; Lock::GlobalWrite lk; + bool firstTime = true; std::vector<std::string> dbNames; getDatabaseNames(dbNames); for (std::vector<std::string>::const_iterator it = dbNames.begin(); it < dbNames.end(); it++) { - checkDB(*it); + checkDB(*it, &firstTime); } cc().shutdown(); } - void IndexRebuilder::checkDB(const std::string& dbName) { + void IndexRebuilder::checkDB(const std::string& dbName, bool* firstTime) { const std::string systemNS = dbName + ".system.namespaces"; DBDirectClient cli; scoped_ptr<DBClientCursor> cursor(cli.query(systemNS, Query())); @@ -77,6 +78,11 @@ namespace mongo { } log() << "Found interrupted index build on " << ns << endl; + if (*firstTime) { + log() << "Restart the server with --noIndexBuildRetry to skip index rebuilds" + << endl; + *firstTime = false; + } // If the indexBuildRetry flag isn't set, just clear the inProg flag if (!cmdLine.indexBuildRetry) { diff --git a/src/mongo/db/index_rebuilder.h b/src/mongo/db/index_rebuilder.h index bd942ebb28e..2b327fbc048 100644 --- a/src/mongo/db/index_rebuilder.h +++ b/src/mongo/db/index_rebuilder.h @@ -32,7 +32,7 @@ namespace mongo { * Check each collection in a database to see if it has any in-progress index builds that * need to be retried. If so, calls retryIndexBuild. */ - void checkDB(const std::string& dbname); + void checkDB(const std::string& dbname, bool* firstTime); /** * Actually retry an index build on a given namespace. |