diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-01-17 17:01:48 -0500 |
---|---|---|
committer | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-01-17 17:09:31 -0500 |
commit | 95ff8eff9c4641240c6158d1b449f1fbabea6a8e (patch) | |
tree | c982cd91dc5f8c4246f7af49bbf2c60e21ebccc9 /src | |
parent | 163249fdf57473baa969a5519456a5d7817bf40b (diff) | |
download | mongo-95ff8eff9c4641240c6158d1b449f1fbabea6a8e.tar.gz |
SERVER-38705 Remove the --noIndexBuildRetry server parameter flag and the storage.indexBuildRetry config file option
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/index_rebuilder.cpp | 14 | ||||
-rw-r--r-- | src/mongo/db/mongod_options.cpp | 39 | ||||
-rw-r--r-- | src/mongo/db/repair_database_and_check_version.cpp | 10 | ||||
-rw-r--r-- | src/mongo/db/server_options.h | 2 |
4 files changed, 0 insertions, 65 deletions
diff --git a/src/mongo/db/index_rebuilder.cpp b/src/mongo/db/index_rebuilder.cpp index bb634c36e22..dd615a2900c 100644 --- a/src/mongo/db/index_rebuilder.cpp +++ b/src/mongo/db/index_rebuilder.cpp @@ -58,7 +58,6 @@ using std::vector; namespace { void checkNS(OperationContext* opCtx, const std::list<std::string>& nsToCheck) { - bool firstTime = true; for (std::list<std::string>::const_iterator it = nsToCheck.begin(); it != nsToCheck.end(); ++it) { NamespaceString nss(*it); @@ -102,18 +101,6 @@ void checkNS(OperationContext* opCtx, const std::list<std::string>& nsToCheck) { log() << "found " << indexesToBuild.size() << " interrupted index build(s) on " << nss.ns(); - if (firstTime) { - log() << "note: restart the server with --noIndexBuildRetry " - << "to skip index rebuilds"; - firstTime = false; - } - - if (!serverGlobalParams.indexBuildRetry) { - log() << " not rebuilding interrupted indexes"; - wunit.commit(); - continue; - } - uassertStatusOK(indexer.init(indexesToBuild)); wunit.commit(); @@ -127,7 +114,6 @@ void checkNS(OperationContext* opCtx, const std::list<std::string>& nsToCheck) { wunit.commit(); } catch (const DBException& e) { error() << "Index rebuilding did not complete: " << redact(e); - log() << "note: restart the server with --noIndexBuildRetry to skip index rebuilds"; // If anything went wrong, leave the indexes partially built so that we pick them up // again on restart. indexer.abortWithoutCleanup(); diff --git a/src/mongo/db/mongod_options.cpp b/src/mongo/db/mongod_options.cpp index a2736bdbc88..297da45d990 100644 --- a/src/mongo/db/mongod_options.cpp +++ b/src/mongo/db/mongod_options.cpp @@ -184,27 +184,6 @@ Status addMongodOptions(moe::OptionSection* options) { "collections within a database into a shared record store.") .hidden(); - // Only allow `noIndexBuildRetry` on standalones to quickly access data. Running with - // `noIndexBuildRetry` is risky in a live replica set. For example, trying to drop a - // collection that did not have its indexes rebuilt results in a crash. - general_options - .addOptionChaining("noIndexBuildRetry", - "noIndexBuildRetry", - moe::Switch, - "don't retry any index builds that were interrupted by shutdown") - .setSources(moe::SourceAllLegacy) - .incompatibleWith("replication.replSet") - .incompatibleWith("replication.replSetName"); - - general_options - .addOptionChaining("storage.indexBuildRetry", - "", - moe::Bool, - "don't retry any index builds that were interrupted by shutdown") - .setSources(moe::SourceYAMLConfig) - .incompatibleWith("replication.replSet") - .incompatibleWith("replication.replSetName"); - storage_options .addOptionChaining("storage.syncPeriodSecs", "syncdelay", @@ -670,20 +649,6 @@ Status canonicalizeMongodOptions(moe::Environment* params) { } } - // "storage.indexBuildRetry" comes from the config file, so override it if - // "noIndexBuildRetry" is set since that comes from the command line. - if (params->count("noIndexBuildRetry")) { - Status ret = params->set("storage.indexBuildRetry", - moe::Value(!(*params)["noIndexBuildRetry"].as<bool>())); - if (!ret.isOK()) { - return ret; - } - ret = params->remove("noIndexBuildRetry"); - if (!ret.isOK()) { - return ret; - } - } - // Ensure that "replication.replSet" logically overrides "replication.replSetName". We // can't canonicalize them as the same option, because they mean slightly different things. // "replication.replSet" can include a seed list, while "replication.replSetName" just has @@ -859,10 +824,6 @@ Status storeMongodOptions(const moe::Environment& params) { params["replication.enableMajorityReadConcern"].as<bool>(); } - if (params.count("storage.indexBuildRetry")) { - serverGlobalParams.indexBuildRetry = params["storage.indexBuildRetry"].as<bool>(); - } - if (params.count("replication.oplogSizeMB")) { long long x = params["replication.oplogSizeMB"].as<int>(); if (x <= 0) { diff --git a/src/mongo/db/repair_database_and_check_version.cpp b/src/mongo/db/repair_database_and_check_version.cpp index 0c134d8c26d..e45fb40ab5b 100644 --- a/src/mongo/db/repair_database_and_check_version.cpp +++ b/src/mongo/db/repair_database_and_check_version.cpp @@ -182,16 +182,6 @@ void rebuildIndexes(OperationContext* opCtx, StorageEngine* storageEngine) { std::vector<StorageEngine::CollectionIndexNamePair> indexesToRebuild = fassert(40593, storageEngine->reconcileCatalogAndIdents(opCtx)); - if (!indexesToRebuild.empty() && serverGlobalParams.indexBuildRetry) { - log() << "note: restart the server with --noIndexBuildRetry " - << "to skip index rebuilds"; - } - - if (!serverGlobalParams.indexBuildRetry) { - log() << " not rebuilding interrupted indexes"; - return; - } - // Determine which indexes need to be rebuilt. rebuildIndexesOnCollection() requires that all // indexes on that collection are done at once, so we use a map to group them together. StringMap<IndexNameObjs> nsToIndexNameObjMap; diff --git a/src/mongo/db/server_options.h b/src/mongo/db/server_options.h index de76672f6e0..839e0eef5f8 100644 --- a/src/mongo/db/server_options.h +++ b/src/mongo/db/server_options.h @@ -59,8 +59,6 @@ struct ServerGlobalParams { int listenBacklog = 0; // --listenBacklog, real default is SOMAXCONN - bool indexBuildRetry = true; // --noIndexBuildRetry - AtomicWord<bool> quiet{false}; // --quiet ClusterRole clusterRole = ClusterRole::None; // --configsvr/--shardsvr |