diff options
Diffstat (limited to 'src/mongo/s/client/shard.cpp')
-rw-r--r-- | src/mongo/s/client/shard.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/mongo/s/client/shard.cpp b/src/mongo/s/client/shard.cpp index be61c500604..0702cdc91a5 100644 --- a/src/mongo/s/client/shard.cpp +++ b/src/mongo/s/client/shard.cpp @@ -110,27 +110,27 @@ bool Shard::isConfig() const { return _id == "config"; } -StatusWith<Shard::CommandResponse> Shard::runCommand(OperationContext* txn, +StatusWith<Shard::CommandResponse> Shard::runCommand(OperationContext* opCtx, const ReadPreferenceSetting& readPref, const std::string& dbName, const BSONObj& cmdObj, RetryPolicy retryPolicy) { - return runCommand(txn, readPref, dbName, cmdObj, Milliseconds::max(), retryPolicy); + return runCommand(opCtx, readPref, dbName, cmdObj, Milliseconds::max(), retryPolicy); } -StatusWith<Shard::CommandResponse> Shard::runCommand(OperationContext* txn, +StatusWith<Shard::CommandResponse> Shard::runCommand(OperationContext* opCtx, const ReadPreferenceSetting& readPref, const std::string& dbName, const BSONObj& cmdObj, Milliseconds maxTimeMSOverride, RetryPolicy retryPolicy) { while (true) { - auto interruptStatus = txn->checkForInterruptNoAssert(); + auto interruptStatus = opCtx->checkForInterruptNoAssert(); if (!interruptStatus.isOK()) { return interruptStatus; } - auto hostWithResponse = _runCommand(txn, readPref, dbName, maxTimeMSOverride, cmdObj); + auto hostWithResponse = _runCommand(opCtx, readPref, dbName, maxTimeMSOverride, cmdObj); auto swCmdResponse = std::move(hostWithResponse.commandResponse); auto commandStatus = _getEffectiveCommandStatus(swCmdResponse); @@ -147,29 +147,29 @@ StatusWith<Shard::CommandResponse> Shard::runCommand(OperationContext* txn, } StatusWith<Shard::CommandResponse> Shard::runCommandWithFixedRetryAttempts( - OperationContext* txn, + OperationContext* opCtx, const ReadPreferenceSetting& readPref, const std::string& dbName, const BSONObj& cmdObj, RetryPolicy retryPolicy) { return runCommandWithFixedRetryAttempts( - txn, readPref, dbName, cmdObj, Milliseconds::max(), retryPolicy); + opCtx, readPref, dbName, cmdObj, Milliseconds::max(), retryPolicy); } StatusWith<Shard::CommandResponse> Shard::runCommandWithFixedRetryAttempts( - OperationContext* txn, + OperationContext* opCtx, const ReadPreferenceSetting& readPref, const std::string& dbName, const BSONObj& cmdObj, Milliseconds maxTimeMSOverride, RetryPolicy retryPolicy) { for (int retry = 1; retry <= kOnErrorNumRetries; ++retry) { - auto interruptStatus = txn->checkForInterruptNoAssert(); + auto interruptStatus = opCtx->checkForInterruptNoAssert(); if (!interruptStatus.isOK()) { return interruptStatus; } - auto hostWithResponse = _runCommand(txn, readPref, dbName, maxTimeMSOverride, cmdObj); + auto hostWithResponse = _runCommand(opCtx, readPref, dbName, maxTimeMSOverride, cmdObj); auto swCmdResponse = std::move(hostWithResponse.commandResponse); auto commandStatus = _getEffectiveCommandStatus(swCmdResponse); @@ -186,7 +186,7 @@ StatusWith<Shard::CommandResponse> Shard::runCommandWithFixedRetryAttempts( } BatchedCommandResponse Shard::runBatchWriteCommandOnConfig( - OperationContext* txn, const BatchedCommandRequest& batchRequest, RetryPolicy retryPolicy) { + OperationContext* opCtx, const BatchedCommandRequest& batchRequest, RetryPolicy retryPolicy) { invariant(isConfig()); const std::string dbname = batchRequest.getNS().db().toString(); @@ -195,7 +195,7 @@ BatchedCommandResponse Shard::runBatchWriteCommandOnConfig( const BSONObj cmdObj = batchRequest.toBSON(); for (int retry = 1; retry <= kOnErrorNumRetries; ++retry) { - auto response = _runCommand(txn, + auto response = _runCommand(opCtx, ReadPreferenceSetting{ReadPreference::PrimaryOnly}, dbname, kDefaultConfigCommandTimeout, @@ -221,7 +221,7 @@ BatchedCommandResponse Shard::runBatchWriteCommandOnConfig( } StatusWith<Shard::QueryResponse> Shard::exhaustiveFindOnConfig( - OperationContext* txn, + OperationContext* opCtx, const ReadPreferenceSetting& readPref, const repl::ReadConcernLevel& readConcernLevel, const NamespaceString& nss, @@ -233,7 +233,7 @@ StatusWith<Shard::QueryResponse> Shard::exhaustiveFindOnConfig( for (int retry = 1; retry <= kOnErrorNumRetries; retry++) { auto result = - _exhaustiveFindOnConfig(txn, readPref, readConcernLevel, nss, query, sort, limit); + _exhaustiveFindOnConfig(opCtx, readPref, readConcernLevel, nss, query, sort, limit); if (retry < kOnErrorNumRetries && isRetriableError(result.getStatus().code(), RetryPolicy::kIdempotent)) { |