diff options
author | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2017-10-20 15:01:53 -0400 |
---|---|---|
committer | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2017-10-20 21:47:10 -0400 |
commit | 367d31e1da549c460ae710a8cc280f4c235ab24f (patch) | |
tree | e5bab44a1e565e9d349d4da72182d9883c71eebc /src/mongo/db/mongod_options.cpp | |
parent | 3944af0d50504ff254330aaeb15eae955ffdb91b (diff) | |
download | mongo-367d31e1da549c460ae710a8cc280f4c235ab24f.tar.gz |
SERVER-31350: Make enableMajorityReadConcern a noop
Diffstat (limited to 'src/mongo/db/mongod_options.cpp')
-rw-r--r-- | src/mongo/db/mongod_options.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/mongo/db/mongod_options.cpp b/src/mongo/db/mongod_options.cpp index 7e31a8f2890..6e68a66f3fb 100644 --- a/src/mongo/db/mongod_options.cpp +++ b/src/mongo/db/mongod_options.cpp @@ -437,10 +437,15 @@ Status addMongodOptions(moe::OptionSection* options) { "specify index prefetching behavior (if secondary) [none|_id_only|all]") .format("(:?none)|(:?_id_only)|(:?all)", "(none/_id_only/all)"); - rs_options.addOptionChaining("replication.enableMajorityReadConcern", - "enableMajorityReadConcern", - moe::Switch, - "enables majority readConcern"); + // `enableMajorityReadConcern` is always enabled starting in 3.6, regardless of user + // settings. We're leaving the option in to not break existing deployment scripts. A warning + // will appear if explicitly set to false. + rs_options + .addOptionChaining("replication.enableMajorityReadConcern", + "enableMajorityReadConcern", + moe::Switch, + "enables majority readConcern") + .setDefault(moe::Value(true)); // Sharding Options @@ -1129,8 +1134,11 @@ Status storeMongodOptions(const moe::Environment& params) { } if (params.count("replication.enableMajorityReadConcern")) { - replSettings.setMajorityReadConcernEnabled( - params["replication.enableMajorityReadConcern"].as<bool>()); + bool val = params["replication.enableMajorityReadConcern"].as<bool>(); + if (!val) { + warning() << "enableMajorityReadConcern startup parameter was supplied, but its value " + "was ignored; majority read concern cannot be disabled."; + } } if (params.count("storage.indexBuildRetry")) { @@ -1196,7 +1204,6 @@ Status storeMongodOptions(const moe::Environment& params) { auto clusterRoleParam = params["sharding.clusterRole"].as<std::string>(); if (clusterRoleParam == "configsvr") { serverGlobalParams.clusterRole = ClusterRole::ConfigServer; - replSettings.setMajorityReadConcernEnabled(true); // If we haven't explicitly specified a journal option, default journaling to true for // the config server role |