summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/shardsvr_move_primary_command.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/shardsvr_move_primary_command.cpp')
-rw-r--r--src/mongo/db/s/shardsvr_move_primary_command.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/mongo/db/s/shardsvr_move_primary_command.cpp b/src/mongo/db/s/shardsvr_move_primary_command.cpp
index de96165a672..dbf579eabf6 100644
--- a/src/mongo/db/s/shardsvr_move_primary_command.cpp
+++ b/src/mongo/db/s/shardsvr_move_primary_command.cpp
@@ -110,11 +110,7 @@ public:
str::stream() << "you have to specify where you want to move it",
!toShard.empty());
- uassert(
- ErrorCodes::InvalidOptions,
- str::stream() << "_shardsvrMovePrimary must be called with majority writeConcern, got "
- << cmdObj,
- opCtx->getWriteConcern().wMode == WriteConcernOptions::kMajority);
+ CommandHelpers::uassertCommandRunWithMajority(getName(), opCtx->getWriteConcern());
ON_BLOCK_EXIT(
[opCtx, dbNss] { Grid::get(opCtx)->catalogCache()->purgeDatabase(dbNss.db()); });