diff options
Diffstat (limited to 'src/mongo/db/s/shard_local.cpp')
| -rw-r--r-- | src/mongo/db/s/shard_local.cpp | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/mongo/db/s/shard_local.cpp b/src/mongo/db/s/shard_local.cpp index 229a61e8480..69ca9ba6332 100644 --- a/src/mongo/db/s/shard_local.cpp +++ b/src/mongo/db/s/shard_local.cpp @@ -36,7 +36,7 @@ #include "mongo/client/remote_command_targeter.h" #include "mongo/db/catalog/index_catalog.h" #include "mongo/db/catalog_raii.h" -#include "mongo/db/concurrency/exception_util.h" +#include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/index/index_descriptor.h" #include "mongo/db/index_builds_coordinator.h" #include "mongo/db/repl/repl_client_info.h" @@ -227,24 +227,4 @@ Status ShardLocal::runAggregation( return _rsLocalClient.runAggregation(opCtx, aggRequest, callback); } -BatchedCommandResponse ShardLocal::runBatchWriteCommand(OperationContext* opCtx, - const Milliseconds maxTimeMS, - const BatchedCommandRequest& batchRequest, - const WriteConcernOptions& writeConcern, - RetryPolicy retryPolicy) { - // A request dispatched through a local client is served within the same thread that submits it - // (so that the opCtx needs to be used as the vehicle to pass the WC to the ServiceEntryPoint). - const auto originalWC = opCtx->getWriteConcern(); - ScopeGuard resetWCGuard([&] { opCtx->setWriteConcern(originalWC); }); - opCtx->setWriteConcern(writeConcern); - - const auto dbName = batchRequest.getNS().db(); - const BSONObj cmdObj = [&] { - BSONObjBuilder cmdObjBuilder; - batchRequest.serialize(&cmdObjBuilder); - return cmdObjBuilder.obj(); - }(); - - return _submitBatchWriteCommand(opCtx, cmdObj, dbName, maxTimeMS, retryPolicy); -} } // namespace mongo |
