summaryrefslogtreecommitdiff
path: root/src/mongo/db/session_catalog.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-10-24 11:43:57 +0200
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-10-25 18:56:12 +0200
commit58cfddf1bdc0aca99a9dcb5666279349621fd156 (patch)
tree3df5cf832bf81f87cb4ce2a1bfceab4328cccb7b /src/mongo/db/session_catalog.h
parent1b897361cdf0119bec00400e4ca287809e87c79b (diff)
downloadmongo-58cfddf1bdc0aca99a9dcb5666279349621fd156.tar.gz
SERVER-37711 Revert commits related to lock yielding for prepared transactions on step down
This change reverts the following commits: * SERVER-35870 Allow stepdown to work with prepared transactions (f96903979ac329a760e7b6f1bb5d8695d3daf2a7) * SERVER-36913 Add functionality to LockManager for repl state transitions with prepared transactions (e65ff57e108ed69c46cc0b0ccbdd675663de2469) * SERVER-35870 Allow more than one thread to block Session checkout at a time (9406af079a894bae80fbbec4703b04974bf84476) * SERVER-35870 Add functionality to prevent Session checkouts & wait for all Sessions to be checked in (c6d90316d6b694e12426274c713a4a078e004fc5)
Diffstat (limited to 'src/mongo/db/session_catalog.h')
-rw-r--r--src/mongo/db/session_catalog.h39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/mongo/db/session_catalog.h b/src/mongo/db/session_catalog.h
index 2da89c2fb7a..addbb3c313c 100644
--- a/src/mongo/db/session_catalog.h
+++ b/src/mongo/db/session_catalog.h
@@ -58,8 +58,6 @@ class SessionCatalog {
friend class ScopedCheckedOutSession;
public:
- class PreventCheckingOutSessionsBlock;
-
SessionCatalog() = default;
~SessionCatalog();
@@ -152,47 +150,10 @@ private:
*/
void _releaseSession(const LogicalSessionId& lsid);
- bool _isSessionCheckoutAllowed() const {
- return _preventSessionCheckoutRequests == 0;
- };
-
- // Protects members below.
stdx::mutex _mutex;
// Owns the Session objects for all current Sessions.
LogicalSessionIdMap<std::shared_ptr<SessionRuntimeInfo>> _sessions;
-
- // Count of the number of Sessions that are currently checked out.
- uint32_t _numCheckedOutSessions{0};
-
- // When >0 all Session checkout or creation requests will block.
- uint32_t _preventSessionCheckoutRequests{0};
-
- // Condition that is signaled when the number of checked out sessions goes to 0.
- stdx::condition_variable _allSessionsCheckedInCond;
-
- // Condition that is signaled when checking out Sessions becomes legal again after having
- // previously been forbidden.
- stdx::condition_variable _checkingOutSessionsAllowedCond;
-};
-
-/**
- * While this object is in scope, all requests to check out a Session will block.
- */
-class SessionCatalog::PreventCheckingOutSessionsBlock {
- MONGO_DISALLOW_COPYING(PreventCheckingOutSessionsBlock);
-
-public:
- explicit PreventCheckingOutSessionsBlock(SessionCatalog* sessionCatalog);
- ~PreventCheckingOutSessionsBlock();
-
- /**
- * Waits until there are no Sessions checked out in the SessionCatalog.
- */
- void waitForAllSessionsToBeCheckedIn(OperationContext* opCtx);
-
-private:
- SessionCatalog* _sessionCatalog{nullptr};
};
/**