summaryrefslogtreecommitdiff
path: root/src/mongo/s/client/shard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/client/shard.cpp')
-rw-r--r--src/mongo/s/client/shard.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/mongo/s/client/shard.cpp b/src/mongo/s/client/shard.cpp
index be61c500604..3aeae9d1386 100644
--- a/src/mongo/s/client/shard.cpp
+++ b/src/mongo/s/client/shard.cpp
@@ -91,7 +91,7 @@ Status Shard::CommandResponse::processBatchWriteResponse(
return status;
}
-const Milliseconds Shard::kDefaultConfigCommandTimeout = Seconds{30};
+const Milliseconds Shard::kDefaultCommandTimeout = Seconds{30};
bool Shard::shouldErrorBePropagated(ErrorCodes::Error code) {
return std::find(RemoteCommandRetryScheduler::kAllRetriableErrors.begin(),
@@ -185,10 +185,9 @@ StatusWith<Shard::CommandResponse> Shard::runCommandWithFixedRetryAttempts(
MONGO_UNREACHABLE;
}
-BatchedCommandResponse Shard::runBatchWriteCommandOnConfig(
- OperationContext* txn, const BatchedCommandRequest& batchRequest, RetryPolicy retryPolicy) {
- invariant(isConfig());
-
+BatchedCommandResponse Shard::runBatchWriteCommand(OperationContext* txn,
+ const BatchedCommandRequest& batchRequest,
+ RetryPolicy retryPolicy) {
const std::string dbname = batchRequest.getNS().db().toString();
invariant(batchRequest.sizeWriteOps() == 1);
@@ -198,7 +197,7 @@ BatchedCommandResponse Shard::runBatchWriteCommandOnConfig(
auto response = _runCommand(txn,
ReadPreferenceSetting{ReadPreference::PrimaryOnly},
dbname,
- kDefaultConfigCommandTimeout,
+ kDefaultCommandTimeout,
cmdObj);
BatchedCommandResponse batchResponse;
@@ -220,7 +219,7 @@ BatchedCommandResponse Shard::runBatchWriteCommandOnConfig(
MONGO_UNREACHABLE;
}
-StatusWith<Shard::QueryResponse> Shard::exhaustiveFindOnConfig(
+StatusWith<Shard::QueryResponse> Shard::exhaustiveFind(
OperationContext* txn,
const ReadPreferenceSetting& readPref,
const repl::ReadConcernLevel& readConcernLevel,
@@ -228,12 +227,8 @@ StatusWith<Shard::QueryResponse> Shard::exhaustiveFindOnConfig(
const BSONObj& query,
const BSONObj& sort,
const boost::optional<long long> limit) {
- // Do not allow exhaustive finds to be run against regular shards.
- invariant(isConfig());
-
for (int retry = 1; retry <= kOnErrorNumRetries; retry++) {
- auto result =
- _exhaustiveFindOnConfig(txn, readPref, readConcernLevel, nss, query, sort, limit);
+ auto result = _exhaustiveFind(txn, readPref, readConcernLevel, nss, query, sort, limit);
if (retry < kOnErrorNumRetries &&
isRetriableError(result.getStatus().code(), RetryPolicy::kIdempotent)) {