From bdd0c8ff4cb70b3c14e2dfbe68c0baa3b26a6e82 Mon Sep 17 00:00:00 2001 From: Blake Oler Date: Wed, 13 Feb 2019 12:44:39 -0500 Subject: SERVER-39561 Split OpObserver::onTransactionCommit() into two functions for unprepared and prepared transactions respectively --- src/mongo/db/op_observer_registry.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/mongo/db/op_observer_registry.h') diff --git a/src/mongo/db/op_observer_registry.h b/src/mongo/db/op_observer_registry.h index 6ea895855d1..946ee8893e9 100644 --- a/src/mongo/db/op_observer_registry.h +++ b/src/mongo/db/op_observer_registry.h @@ -258,13 +258,22 @@ public: o->onEmptyCapped(opCtx, collectionName, uuid); } - void onTransactionCommit(OperationContext* opCtx, - boost::optional commitOplogEntryOpTime, - boost::optional commitTimestamp, - std::vector& statements) override { + void onUnpreparedTransactionCommit( + OperationContext* opCtx, const std::vector& statements) override { ReservedTimes times{opCtx}; for (auto& o : _observers) - o->onTransactionCommit(opCtx, commitOplogEntryOpTime, commitTimestamp, statements); + o->onUnpreparedTransactionCommit(opCtx, statements); + } + + void onPreparedTransactionCommit( + OperationContext* opCtx, + OplogSlot commitOplogEntryOpTime, + Timestamp commitTimestamp, + const std::vector& statements) noexcept override { + ReservedTimes times{opCtx}; + for (auto& o : _observers) + o->onPreparedTransactionCommit( + opCtx, commitOplogEntryOpTime, commitTimestamp, statements); } void onTransactionPrepare(OperationContext* opCtx, -- cgit v1.2.1