summaryrefslogtreecommitdiff
path: root/src/mongo/db/session_catalog.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2017-09-20 11:03:05 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2017-09-20 11:15:47 -0400
commitc565d15a53cd6dd452da97d49c6b9c6cbffb6cf1 (patch)
tree93abf8b71235cceb895df4ce50dda2ef14929948 /src/mongo/db/session_catalog.h
parent8a5656c58c18e7c23d5bec6f9b2d41013ee80a47 (diff)
downloadmongo-c565d15a53cd6dd452da97d49c6b9c6cbffb6cf1.tar.gz
SERVER-31114 Perform targeted session invalidation on direct writes to `config.transactions`
Diffstat (limited to 'src/mongo/db/session_catalog.h')
-rw-r--r--src/mongo/db/session_catalog.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mongo/db/session_catalog.h b/src/mongo/db/session_catalog.h
index 3e03c97d83d..e0432c439f5 100644
--- a/src/mongo/db/session_catalog.h
+++ b/src/mongo/db/session_catalog.h
@@ -112,10 +112,16 @@ public:
ScopedSession getOrCreateSession(OperationContext* opCtx, const LogicalSessionId& lsid);
/**
- * Resets all created sessions and increments their generation, forcing each to be reloaded by
- * subsequent write commands. Invoked after rollback.
+ * Callback to be invoked when it is suspected that the on-disk session contents might not be in
+ * sync with what is in the sessions cache.
+ *
+ * If no specific document is available, the method will invalidate all sessions. Otherwise if
+ * one is avaiable (which is the case for insert/update/delete), it must contain _id field with
+ * a valid session entry, in which case only that particular session will be invalidated. If the
+ * _id field is missing or doesn't contain a valid serialization of logical session, the method
+ * will throw. This prevents invalid entries from making it in the collection.
*/
- void resetSessions();
+ void invalidateSessions(OperationContext* opCtx, boost::optional<BSONObj> singleSessionDoc);
private:
struct SessionRuntimeInfo {