summaryrefslogtreecommitdiff
path: root/src/mongo/db/server_options_helpers.cpp
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2018-12-11 21:35:15 +0000
committerSara Golemon <sara.golemon@mongodb.com>2018-12-17 16:15:06 +0000
commitdb3a8c4daddcefc4506c010699b1f6d3dce2c910 (patch)
tree2b310be65c8463fa5ef4bfab89247d370f6700b7 /src/mongo/db/server_options_helpers.cpp
parentcce23861d5a0141b556b3d476812d8d5ded71d5d (diff)
downloadmongo-db3a8c4daddcefc4506c010699b1f6d3dce2c910.tar.gz
SERVER-25323 Allow marking ServerParameters as 'test only'
Diffstat (limited to 'src/mongo/db/server_options_helpers.cpp')
-rw-r--r--src/mongo/db/server_options_helpers.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/server_options_helpers.cpp b/src/mongo/db/server_options_helpers.cpp
index 176a3c3eb08..ae17cce3da2 100644
--- a/src/mongo/db/server_options_helpers.cpp
+++ b/src/mongo/db/server_options_helpers.cpp
@@ -291,11 +291,14 @@ Status validateBaseOptions(const moe::Environment& params) {
std::map<std::string, std::string> parameters =
params["setParameter"].as<std::map<std::string, std::string>>();
- // Only register failpoint server parameters if enableTestCommands=1.
auto enableTestCommandsParameter = parameters.find("enableTestCommands");
if (enableTestCommandsParameter != parameters.end() &&
enableTestCommandsParameter->second.compare("1") == 0) {
+ // Only register failpoint server parameters if enableTestCommands=1.
getGlobalFailPointRegistry()->registerAllFailPointsAsServerParameters();
+ } else {
+ // Deregister test-only parameters.
+ ServerParameterSet::getGlobal()->disableTestParameters();
}
}