diff options
author | Spencer T Brody <spencer@mongodb.com> | 2016-08-26 17:47:07 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@mongodb.com> | 2016-08-26 18:23:45 -0400 |
commit | 7614c0eb2449eb4ec22d21b677177124d61f1888 (patch) | |
tree | 270f40e904bec17cbb30f696450e3401cfe03172 /src/mongo/s/client/shard.cpp | |
parent | ff52022e5cd7ff7c75daf24c8760f0377785ba1e (diff) | |
download | mongo-7614c0eb2449eb4ec22d21b677177124d61f1888.tar.gz |
SERVER-25832 Rename Shard::runCommand to Shard::runCommandWithFixedRetryAttempts
Diffstat (limited to 'src/mongo/s/client/shard.cpp')
-rw-r--r-- | src/mongo/s/client/shard.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/mongo/s/client/shard.cpp b/src/mongo/s/client/shard.cpp index 445b63b3dbe..622c6ea7c50 100644 --- a/src/mongo/s/client/shard.cpp +++ b/src/mongo/s/client/shard.cpp @@ -106,7 +106,7 @@ StatusWith<Shard::CommandResponse> Shard::runCommand(OperationContext* txn, const std::string& dbName, const BSONObj& cmdObj, RetryPolicy retryPolicy) { - return runCommand(txn, readPref, dbName, cmdObj, Milliseconds::max(), retryPolicy); + MONGO_UNREACHABLE; } StatusWith<Shard::CommandResponse> Shard::runCommand(OperationContext* txn, @@ -115,6 +115,26 @@ StatusWith<Shard::CommandResponse> Shard::runCommand(OperationContext* txn, const BSONObj& cmdObj, Milliseconds maxTimeMSOverride, RetryPolicy retryPolicy) { + MONGO_UNREACHABLE; +} + +StatusWith<Shard::CommandResponse> Shard::runCommandWithFixedRetryAttempts( + OperationContext* txn, + const ReadPreferenceSetting& readPref, + const std::string& dbName, + const BSONObj& cmdObj, + RetryPolicy retryPolicy) { + return runCommandWithFixedRetryAttempts( + txn, readPref, dbName, cmdObj, Milliseconds::max(), retryPolicy); +} + +StatusWith<Shard::CommandResponse> Shard::runCommandWithFixedRetryAttempts( + OperationContext* txn, + const ReadPreferenceSetting& readPref, + const std::string& dbName, + const BSONObj& cmdObj, + Milliseconds maxTimeMSOverride, + RetryPolicy retryPolicy) { for (int retry = 1; retry <= kOnErrorNumRetries; ++retry) { auto hostWithResponse = _runCommand(txn, readPref, dbName, maxTimeMSOverride, cmdObj); auto swCmdResponse = std::move(hostWithResponse.commandResponse); |