diff options
author | Spencer T Brody <spencer@mongodb.com> | 2016-03-02 18:40:30 -0500 |
---|---|---|
committer | Spencer T Brody <spencer@mongodb.com> | 2016-03-07 14:00:54 -0500 |
commit | c918dc295e6e5971e5f9f7c8fde5bee7e4c216b0 (patch) | |
tree | 31054c5d0d0e1af2f103147e6c66381262e65488 /src/mongo/s/balancer_policy.cpp | |
parent | cfa10de6e60b4eb0fbaa39d8d5e3a3774ad47b95 (diff) | |
download | mongo-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.cpp | 12 |
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"}); |