summaryrefslogtreecommitdiff
path: root/src/mongo/db/session_catalog_mongod.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-11-14 09:00:30 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-11-16 03:26:19 -0500
commit943b0f7294b1f30483cc9d0fa4e870b00a68465d (patch)
tree8673dae5e032f4abf6aaba537acaf0a88f54bfeb /src/mongo/db/session_catalog_mongod.h
parent72789f5739982af1cbdb1dd4fa181c4924f657b3 (diff)
downloadmongo-943b0f7294b1f30483cc9d0fa4e870b00a68465d.tar.gz
SERVER-37665 Get rid of the 'checkOutSession' parameter of OperationContextSession
This simplifies the behaviour of the class and moves all the check-out decision taking to happen in the only consumer - the endpoint. Also renames OperationContextSessionMongoD to MongoDOperationContextSession in order to be in sync with the naming nomenclature of SessionCatalog and MongoDSessionCatalog.
Diffstat (limited to 'src/mongo/db/session_catalog_mongod.h')
-rw-r--r--src/mongo/db/session_catalog_mongod.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mongo/db/session_catalog_mongod.h b/src/mongo/db/session_catalog_mongod.h
index 4496c8b17f3..c71e0dce076 100644
--- a/src/mongo/db/session_catalog_mongod.h
+++ b/src/mongo/db/session_catalog_mongod.h
@@ -65,4 +65,32 @@ public:
boost::optional<BSONObj> singleSessionDoc);
};
+/**
+ * Scoped object, which checks out the session specified in the passed operation context and stores
+ * it for later access by the command. The session is installed at construction time and is removed
+ * at destruction.
+ */
+class MongoDOperationContextSession {
+public:
+ MongoDOperationContextSession(OperationContext* opCtx);
+
+private:
+ OperationContextSession _operationContextSession;
+};
+
+/**
+ * Similar to MongoDOperationContextSession, but marks the TransactionParticipant as valid without
+ * refreshing from disk and starts a new transaction unconditionally.
+ *
+ * NOTE: Only used by the replication oplog application logic on secondaries in order to replay
+ * prepared transactions.
+ */
+class MongoDOperationContextSessionWithoutRefresh {
+public:
+ MongoDOperationContextSessionWithoutRefresh(OperationContext* opCtx);
+
+private:
+ OperationContextSession _operationContextSession;
+};
+
} // namespace mongo