summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/rwc_defaults_commands.cpp
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2020-01-08 20:22:44 +0000
committerevergreen <evergreen@mongodb.com>2020-01-08 20:22:44 +0000
commitd205919f8acfc2c044338ff94455d1feea1852e4 (patch)
tree7f2f27fd4f3fc0a2e69cbbb5822725b2a63908df /src/mongo/db/commands/rwc_defaults_commands.cpp
parent39f48ff919a0ffae178511b4d585e6776a92733c (diff)
downloadmongo-d205919f8acfc2c044338ff94455d1feea1852e4.tar.gz
SERVER-43723 FCV gating for RWC defaults
Diffstat (limited to 'src/mongo/db/commands/rwc_defaults_commands.cpp')
-rw-r--r--src/mongo/db/commands/rwc_defaults_commands.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/commands/rwc_defaults_commands.cpp b/src/mongo/db/commands/rwc_defaults_commands.cpp
index 681057ef414..0253c2dc31a 100644
--- a/src/mongo/db/commands/rwc_defaults_commands.cpp
+++ b/src/mongo/db/commands/rwc_defaults_commands.cpp
@@ -102,6 +102,12 @@ public:
auto typedRun(OperationContext* opCtx) {
assertNotStandaloneOrShardServer(opCtx, SetDefaultRWConcern::kCommandName);
+ uassert(ErrorCodes::CommandNotSupported,
+ str::stream() << "'" << SetDefaultRWConcern::kCommandName
+ << "' is only supported in feature compatibility version 4.4",
+ serverGlobalParams.featureCompatibility.getVersion() ==
+ ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44);
+
auto& rwcDefaults = ReadWriteConcernDefaults::get(opCtx->getServiceContext());
auto newDefaults = rwcDefaults.generateNewConcerns(
opCtx, request().getDefaultReadConcern(), request().getDefaultWriteConcern());