diff options
Diffstat (limited to 'src/mongo/db/fle_crud.cpp')
| -rw-r--r-- | src/mongo/db/fle_crud.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mongo/db/fle_crud.cpp b/src/mongo/db/fle_crud.cpp index 740df62969a..dfeb35c1487 100644 --- a/src/mongo/db/fle_crud.cpp +++ b/src/mongo/db/fle_crud.cpp @@ -41,9 +41,7 @@ #include "mongo/crypto/encryption_fields_gen.h" #include "mongo/crypto/fle_crypto.h" #include "mongo/db/auth/authorization_session.h" -#include "mongo/db/dbdirectclient.h" #include "mongo/db/namespace_string.h" -#include "mongo/db/operation_time_tracker.h" #include "mongo/db/ops/write_ops_gen.h" #include "mongo/db/ops/write_ops_parsers.h" #include "mongo/db/query/collation/collator_factory_interface.h" @@ -114,8 +112,7 @@ void replyToResponse(OperationContext* opCtx, // committed. The Transaction API propagates the OpTime from the commit transaction onto the // current thread so grab it from TLS and change the OpTime on the reply. // - response->setLastOp({OperationTimeTracker::get(opCtx)->getMaxOperationTime().asTimestamp(), - repl::OpTime::kUninitializedTerm}); + response->setLastOp(repl::ReplClientInfo::forClient(opCtx->getClient()).getLastOp()); } void responseToReply(const BatchedCommandResponse& response, @@ -1283,10 +1280,12 @@ uint64_t FLEQueryInterfaceImpl::countDocuments(const NamespaceString& nss) { CountCommandRequest ccr(nss); auto opMsgRequest = ccr.serialize(BSONObj()); - DBDirectClient directClient(opCtx.get()); - auto uniqueReply = directClient.runCommand(opMsgRequest); + auto requestMessage = opMsgRequest.serialize(); - auto reply = uniqueReply->getCommandReply(); + auto serviceEntryPoint = opCtx->getServiceContext()->getServiceEntryPoint(); + DbResponse dbResponse = serviceEntryPoint->handleRequest(opCtx.get(), requestMessage).get(); + + auto reply = rpc::makeReply(&dbResponse.response)->getCommandReply().getOwned(); auto status = getStatusFromWriteCommandReply(reply); uassertStatusOK(status); |
