summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2016-09-05 11:20:19 +1000
committerDon Anderson <dda@mongodb.com>2017-06-22 22:28:31 -0400
commit0869941cc2d7391ba41e6e5d1f7aceb6df4f6573 (patch)
tree227b01fed6e451c2b8a930dc5161be92d10b31af /src
parent3221f3ffcaf29ed36ce59453637321bdbd2a1fed (diff)
downloadmongo-0869941cc2d7391ba41e6e5d1f7aceb6df4f6573.tar.gz
SERVER-25789 Reset WiredTiger sessions before caching.
(cherry picked from commit 8ef6560b08267ad7b073a21dab19d1618ba02efc)
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp
index 26d69fd4843..cb1282a6790 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp
@@ -310,13 +310,16 @@ void WiredTigerSessionCache::releaseSession(WiredTigerSession* session) {
return;
}
- // This checks that we are only caching idle sessions and not something which might hold
- // locks or otherwise prevent truncation.
{
WT_SESSION* ss = session->getSession();
uint64_t range;
+ // This checks that we are only caching idle sessions and not something which might hold
+ // locks or otherwise prevent truncation.
invariantWTOK(ss->transaction_pinned_range(ss, &range));
invariant(range == 0);
+
+ // Release resources in the session we're about to cache.
+ invariantWTOK(ss->reset(ss));
}
// If the cursor epoch has moved on, close all cursors in the session.