diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2019-04-18 17:26:44 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2019-05-02 17:32:13 -0400 |
commit | dcf7912e275b72d1462d4ecf26f195f8accb45ad (patch) | |
tree | d96248496d8fa66ccd73fb3c1038bd67c801ad10 /src/mongo/db/session_catalog.cpp | |
parent | dabbf059e6f96edb4898b42d532d460efd2510f2 (diff) | |
download | mongo-dcf7912e275b72d1462d4ecf26f195f8accb45ad.tar.gz |
SERVER-36483 Do not reap transaction entries for prepared transactions
Diffstat (limited to 'src/mongo/db/session_catalog.cpp')
-rw-r--r-- | src/mongo/db/session_catalog.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/session_catalog.cpp b/src/mongo/db/session_catalog.cpp index cade0e53405..a82af347a04 100644 --- a/src/mongo/db/session_catalog.cpp +++ b/src/mongo/db/session_catalog.cpp @@ -116,6 +116,14 @@ SessionCatalog::SessionToKill SessionCatalog::checkOutSessionForKill(OperationCo return SessionToKill(ScopedCheckedOutSession(*this, std::move(sri), std::move(killToken))); } +void SessionCatalog::scanSession(const LogicalSessionId& lsid, + const ScanSessionsCallbackFn& workerFn) { + stdx::lock_guard<stdx::mutex> lg(_mutex); + auto it = _sessions.find(lsid); + if (it != _sessions.end()) + workerFn({lg, it->second->session}); +} + void SessionCatalog::scanSessions(const SessionKiller::Matcher& matcher, const ScanSessionsCallbackFn& workerFn) { stdx::lock_guard<stdx::mutex> lg(_mutex); |