diff options
author | Esha Maharishi <esha.maharishi@mongodb.com> | 2017-10-12 21:52:12 -0400 |
---|---|---|
committer | Esha Maharishi <esha.maharishi@mongodb.com> | 2017-10-17 15:32:55 -0400 |
commit | 9abf192c564e60cef196921dc1c20efddbdf6477 (patch) | |
tree | ce28484b6542ecd135f7251abf0368e3f6b7fe5c /src/mongo/db/s/config/configsvr_remove_shard_command.cpp | |
parent | aeabbf96ff3c2990f553ba0a5e6e1d18ebddab2f (diff) | |
download | mongo-9abf192c564e60cef196921dc1c20efddbdf6477.tar.gz |
SERVER-31524 make all metadata commands wait for majority writeConcern when returning success early
Diffstat (limited to 'src/mongo/db/s/config/configsvr_remove_shard_command.cpp')
-rw-r--r-- | src/mongo/db/s/config/configsvr_remove_shard_command.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/s/config/configsvr_remove_shard_command.cpp b/src/mongo/db/s/config/configsvr_remove_shard_command.cpp index b7c10d58540..ad4188d7647 100644 --- a/src/mongo/db/s/config/configsvr_remove_shard_command.cpp +++ b/src/mongo/db/s/config/configsvr_remove_shard_command.cpp @@ -98,6 +98,11 @@ public: cmdObj.firstElement().type() == BSONType::String); const std::string target = cmdObj.firstElement().str(); + uassert(ErrorCodes::InvalidOptions, + str::stream() << "removeShard must be called with majority writeConcern, got " + << cmdObj, + opCtx->getWriteConcern().wMode == WriteConcernOptions::kMajority); + const auto shardStatus = Grid::get(opCtx)->shardRegistry()->getShard(opCtx, ShardId(target)); if (!shardStatus.isOK()) { |