diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2017-10-16 15:29:41 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2017-10-18 08:14:38 -0400 |
commit | c3f581ee05ca1252aa2f42bbf16a913f9f819e1d (patch) | |
tree | d27f776e475be72bac358d64a35ab9f65c616098 /src/mongo/db/session_catalog.h | |
parent | 689e308e910b1c689246da34ac85ca0198f68e4a (diff) | |
download | mongo-c3f581ee05ca1252aa2f42bbf16a913f9f819e1d.tar.gz |
SERVER-31342 Do not remove checked-out sessions from the cache on invalidation
Diffstat (limited to 'src/mongo/db/session_catalog.h')
-rw-r--r-- | src/mongo/db/session_catalog.h | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/mongo/db/session_catalog.h b/src/mongo/db/session_catalog.h index e0432c439f5..6aa4e4d0442 100644 --- a/src/mongo/db/session_catalog.h +++ b/src/mongo/db/session_catalog.h @@ -127,22 +127,10 @@ private: struct SessionRuntimeInfo { SessionRuntimeInfo(LogicalSessionId lsid) : txnState(std::move(lsid)) {} - enum State { - // Session can be checked out - kAvailable, - - // Session is in use by another operation and the caller must wait to check it out - kInUse, - - // Session is at the end of its lifetime and is in a state where its persistent - // information is being cleaned up. Sessions in this state can never be checked out. The - // reason to put the session in this state is to allow for cleanup to happen - // asynchronous and while not holding locks. - kInCleanup - }; - - // Current state of the runtime info for a session - State state{kAvailable}; + // Current check-out state of the session. If set to false, the session can be checked out. + // If set to true, the session is in use by another operation and the caller must wait to + // check it out. + bool checkedOut{false}; // Signaled when the state becomes available. Uses the transaction table's mutex to protect // the state transitions. |