summaryrefslogtreecommitdiff
path: root/src/mongo/db/session_catalog.cpp
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2018-02-22 12:22:19 -0500
committerTess Avitabile <tess.avitabile@mongodb.com>2018-02-23 13:07:33 -0500
commit0f1a697cea94307c4aec72e8309372254e1f3570 (patch)
treec3846ab20d1a276904d5290a28dce8773686d262 /src/mongo/db/session_catalog.cpp
parentd390a83e8273655db73bfb6dfe3f8eb7bdda6c67 (diff)
downloadmongo-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.cpp22
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);
+ }
}
}
}