summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/shardsvr_set_allow_migrations_command.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/shardsvr_set_allow_migrations_command.cpp')
-rw-r--r--src/mongo/db/s/shardsvr_set_allow_migrations_command.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mongo/db/s/shardsvr_set_allow_migrations_command.cpp b/src/mongo/db/s/shardsvr_set_allow_migrations_command.cpp
index 1703dd86829..401356eb0f9 100644
--- a/src/mongo/db/s/shardsvr_set_allow_migrations_command.cpp
+++ b/src/mongo/db/s/shardsvr_set_allow_migrations_command.cpp
@@ -72,11 +72,8 @@ public:
opCtx->setAlwaysInterruptAtStepDownOrUp();
- uassert(ErrorCodes::InvalidOptions,
- str::stream() << Request::kCommandName
- << " must be called with majority writeConcern, got "
- << request().toBSON(BSONObj()),
- opCtx->getWriteConcern().wMode == WriteConcernOptions::kMajority);
+ CommandHelpers::uassertCommandRunWithMajority(Request::kCommandName,
+ opCtx->getWriteConcern());
SetAllowMigrationsRequest setAllowMigationsCmdRequest =
request().getSetAllowMigrationsRequest();