diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2018-02-22 12:22:19 -0500 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2018-02-23 13:07:33 -0500 |
commit | 0f1a697cea94307c4aec72e8309372254e1f3570 (patch) | |
tree | c3846ab20d1a276904d5290a28dce8773686d262 /src/mongo/db/session_catalog.cpp | |
parent | d390a83e8273655db73bfb6dfe3f8eb7bdda6c67 (diff) | |
download | mongo-0f1a697cea94307c4aec72e8309372254e1f3570.tar.gz |
SERVER-33440 DBDirectClient operations should be able to perform session checkout
Diffstat (limited to 'src/mongo/db/session_catalog.cpp')
-rw-r--r-- | src/mongo/db/session_catalog.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
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); + } } } } |