summaryrefslogtreecommitdiff
path: root/src/mongo/s/balancer_policy.cpp
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2016-03-02 18:40:30 -0500
committerSpencer T Brody <spencer@mongodb.com>2016-03-07 14:00:54 -0500
commitc918dc295e6e5971e5f9f7c8fde5bee7e4c216b0 (patch)
tree31054c5d0d0e1af2f103147e6c66381262e65488 /src/mongo/s/balancer_policy.cpp
parentcfa10de6e60b4eb0fbaa39d8d5e3a3774ad47b95 (diff)
downloadmongo-c918dc295e6e5971e5f9f7c8fde5bee7e4c216b0.tar.gz
SERVER-22937 Retry operations run through the ShardRegistry wherever possible
Diffstat (limited to 'src/mongo/s/balancer_policy.cpp')
-rw-r--r--src/mongo/s/balancer_policy.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/s/balancer_policy.cpp b/src/mongo/s/balancer_policy.cpp
index 473e13ed6c9..f8ff4c49f65 100644
--- a/src/mongo/s/balancer_policy.cpp
+++ b/src/mongo/s/balancer_policy.cpp
@@ -69,12 +69,12 @@ namespace {
std::string retrieveShardMongoDVersion(OperationContext* txn,
ShardId shardId,
ShardRegistry* shardRegistry) {
- BSONObj serverStatus = uassertStatusOK(
- shardRegistry->runCommandOnShard(txn,
- shardId,
- ReadPreferenceSetting{ReadPreference::PrimaryOnly},
- "admin",
- BSON("serverStatus" << 1)));
+ BSONObj serverStatus = uassertStatusOK(shardRegistry->runIdempotentCommandOnShard(
+ txn,
+ shardId,
+ ReadPreferenceSetting{ReadPreference::PrimaryOnly},
+ "admin",
+ BSON("serverStatus" << 1)));
BSONElement versionElement = serverStatus["version"];
if (versionElement.type() != String) {
uassertStatusOK({ErrorCodes::NoSuchKey, "version field not found in serverStatus"});