summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/config/configsvr_add_shard_command.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/config/configsvr_add_shard_command.cpp')
-rw-r--r--src/mongo/db/s/config/configsvr_add_shard_command.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/mongo/db/s/config/configsvr_add_shard_command.cpp b/src/mongo/db/s/config/configsvr_add_shard_command.cpp
index 7504b149e50..7e45c082250 100644
--- a/src/mongo/db/s/config/configsvr_add_shard_command.cpp
+++ b/src/mongo/db/s/config/configsvr_add_shard_command.cpp
@@ -98,11 +98,7 @@ public:
uassert(ErrorCodes::IllegalOperation,
"_configsvrAddShard can only be run on config servers",
serverGlobalParams.clusterRole == ClusterRole::ConfigServer);
- uassert(
- ErrorCodes::InvalidOptions,
- str::stream() << "_configsvrAddShard must be called with majority writeConcern, got "
- << cmdObj,
- opCtx->getWriteConcern().wMode == WriteConcernOptions::kMajority);
+ CommandHelpers::uassertCommandRunWithMajority(getName(), opCtx->getWriteConcern());
// Set the operation context read concern level to local for reads into the config database.
repl::ReadConcernArgs::get(opCtx) =