summaryrefslogtreecommitdiff
path: root/src/mongo/db/op_observer.h
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@10gen.com>2018-02-12 10:08:44 -0500
committerMatthew Russotto <matthew.russotto@10gen.com>2018-02-13 14:00:58 -0500
commit0f4b9e146be4cf9b612e34c500d91b4fdb91b07a (patch)
treee785b82c76e11f27421f6adc747f191f1b39e50a /src/mongo/db/op_observer.h
parenta4321b24021f6c1ec376c1c3b79f59732a3463e4 (diff)
downloadmongo-0f4b9e146be4cf9b612e34c500d91b4fdb91b07a.tar.gz
SERVER-33058 Add onTransactionCommit and onTransactionAbort opObservers
Diffstat (limited to 'src/mongo/db/op_observer.h')
-rw-r--r--src/mongo/db/op_observer.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/db/op_observer.h b/src/mongo/db/op_observer.h
index 6ce3ea26fd5..7cbfbcc09b6 100644
--- a/src/mongo/db/op_observer.h
+++ b/src/mongo/db/op_observer.h
@@ -221,6 +221,17 @@ public:
virtual void onEmptyCapped(OperationContext* opCtx,
const NamespaceString& collectionName,
OptionalCollectionUUID uuid) = 0;
+ /**
+ * The onTransactionCommit method is called on the commit of an atomic transaction, before the
+ * RecoveryUnit onCommit() is called. It must not be called when no transaction is active.
+ */
+ virtual void onTransactionCommit(OperationContext* opCtx) = 0;
+
+ /**
+ * The onTransactionAbort method is called when an atomic transaction aborts, before the
+ * RecoveryUnit onRollback() is called. It must not be called when no transaction is active.
+ */
+ virtual void onTransactionAbort(OperationContext* opCtx) = 0;
};
} // namespace mongo