summaryrefslogtreecommitdiff
path: root/src/mongo/s/client/shard_local_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/client/shard_local_test.cpp')
-rw-r--r--src/mongo/s/client/shard_local_test.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/mongo/s/client/shard_local_test.cpp b/src/mongo/s/client/shard_local_test.cpp
index 409d8dba86d..3bd026db9ed 100644
--- a/src/mongo/s/client/shard_local_test.cpp
+++ b/src/mongo/s/client/shard_local_test.cpp
@@ -103,19 +103,21 @@ StatusWith<Shard::CommandResponse> ShardLocalTest::runFindAndModifyRunCommand(Na
findAndModifyRequest.setWriteConcern(WriteConcernOptions(
WriteConcernOptions::kMajority, WriteConcernOptions::SyncMode::UNSET, Seconds(15)));
- return _shardLocal->runCommand(_txn.get(),
- ReadPreferenceSetting{ReadPreference::PrimaryOnly},
- nss.db().toString(),
- findAndModifyRequest.toBSON(),
- Shard::RetryPolicy::kNoRetry);
+ return _shardLocal->runCommandWithFixedRetryAttempts(
+ _txn.get(),
+ ReadPreferenceSetting{ReadPreference::PrimaryOnly},
+ nss.db().toString(),
+ findAndModifyRequest.toBSON(),
+ Shard::RetryPolicy::kNoRetry);
}
StatusWith<std::vector<BSONObj>> ShardLocalTest::getIndexes(NamespaceString nss) {
- auto response = _shardLocal->runCommand(_txn.get(),
- ReadPreferenceSetting{ReadPreference::PrimaryOnly},
- nss.db().toString(),
- BSON("listIndexes" << nss.coll().toString()),
- Shard::RetryPolicy::kIdempotent);
+ auto response = _shardLocal->runCommandWithFixedRetryAttempts(
+ _txn.get(),
+ ReadPreferenceSetting{ReadPreference::PrimaryOnly},
+ nss.db().toString(),
+ BSON("listIndexes" << nss.coll().toString()),
+ Shard::RetryPolicy::kIdempotent);
if (!response.isOK()) {
return response.getStatus();
}