From 0f1a697cea94307c4aec72e8309372254e1f3570 Mon Sep 17 00:00:00 2001 From: Tess Avitabile Date: Thu, 22 Feb 2018 12:22:19 -0500 Subject: SERVER-33440 DBDirectClient operations should be able to perform session checkout --- src/mongo/db/session_catalog.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'src/mongo/db/session_catalog.cpp') diff --git a/src/mongo/db/session_catalog.cpp b/src/mongo/db/session_catalog.cpp index f651b7121f9..dcccae45804 100644 --- a/src/mongo/db/session_catalog.cpp +++ b/src/mongo/db/session_catalog.cpp @@ -292,14 +292,11 @@ OperationContextSession::~OperationContextSession() { } void OperationContextSession::stashTransactionResources() { - if (_opCtx->getClient()->isInDirectClient()) { - return; - } - if (auto& checkedOutSession = operationSessionDecoration(_opCtx)) { - invariant(checkedOutSession->checkOutNestingLevel == 1); - if (auto session = checkedOutSession->scopedSession.get()) { - session->stashTransactionResources(_opCtx); + if (checkedOutSession->checkOutNestingLevel == 1) { + if (auto session = checkedOutSession->scopedSession.get()) { + session->stashTransactionResources(_opCtx); + } } } } @@ -309,14 +306,11 @@ void OperationContextSession::unstashTransactionResources() { return; } - if (_opCtx->getClient()->isInDirectClient()) { - return; - } - if (auto& checkedOutSession = operationSessionDecoration(_opCtx)) { - invariant(checkedOutSession->checkOutNestingLevel == 1); - if (auto session = checkedOutSession->scopedSession.get()) { - session->unstashTransactionResources(_opCtx); + if (checkedOutSession->checkOutNestingLevel == 1) { + if (auto session = checkedOutSession->scopedSession.get()) { + session->unstashTransactionResources(_opCtx); + } } } } -- cgit v1.2.1