diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2018-03-15 16:16:58 -0400 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2018-03-20 10:25:27 -0400 |
commit | 374f14d984da357c943098735e7e6d13f250675a (patch) | |
tree | 91662f7eb9a6d9582dff0a7e312fffbc9a85398f /src/mongo/db/session_catalog.h | |
parent | 15400ae3c7ec6830e0f80b3dd84fd89632b73648 (diff) | |
download | mongo-374f14d984da357c943098735e7e6d13f250675a.tar.gz |
SERVER-33669 Stepdown and shutdown should abort all uncommitted transactions
Diffstat (limited to 'src/mongo/db/session_catalog.h')
-rw-r--r-- | src/mongo/db/session_catalog.h | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/mongo/db/session_catalog.h b/src/mongo/db/session_catalog.h index d3b37c2183c..e5b45432285 100644 --- a/src/mongo/db/session_catalog.h +++ b/src/mongo/db/session_catalog.h @@ -53,24 +53,11 @@ class SessionCatalog { friend class ScopedCheckedOutSession; public: - explicit SessionCatalog(ServiceContext* serviceContext); + SessionCatalog() = default; ~SessionCatalog(); /** - * Instantiates a transaction table on the specified service context. Must be called only once - * and is not thread-safe. - */ - static void create(ServiceContext* service); - - /** - * Resets the transaction table on the specified service context to an uninitialized state. - * Meant only for testing. - */ - static void reset_forTest(ServiceContext* service); - - /** * Retrieves the session transaction table associated with the service or operation context. - * Must only be called after 'create' has been called. */ static SessionCatalog* get(OperationContext* opCtx); static SessionCatalog* get(ServiceContext* service); @@ -82,6 +69,12 @@ public: static boost::optional<UUID> getTransactionTableUUID(OperationContext* opCtx); /** + * Resets the transaction table to an uninitialized state. + * Meant only for testing. + */ + void reset_forTest(); + + /** * Invoked when the node enters the primary state. Ensures that the transactions collection is * created. Throws on severe exceptions due to which it is not safe to continue the step-up * process. @@ -189,8 +182,6 @@ private: */ void _releaseSession(const LogicalSessionId& lsid); - ServiceContext* const _serviceContext; - stdx::mutex _mutex; SessionRuntimeInfoMap _txnTable; }; |