summaryrefslogtreecommitdiff
path: root/src/mongo/db/transaction_participant_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/transaction_participant_test.cpp')
-rw-r--r--src/mongo/db/transaction_participant_test.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/mongo/db/transaction_participant_test.cpp b/src/mongo/db/transaction_participant_test.cpp
index a364e9f8283..932ef261e88 100644
--- a/src/mongo/db/transaction_participant_test.cpp
+++ b/src/mongo/db/transaction_participant_test.cpp
@@ -100,14 +100,16 @@ class OpObserverMock : public OpObserverNoop {
public:
void onTransactionPrepare(OperationContext* opCtx,
const std::vector<OplogSlot>& reservedSlots,
- std::vector<repl::ReplOperation>& statements) override;
+ std::vector<repl::ReplOperation>* statements,
+ size_t numberOfPreImagesToWrite) override;
bool onTransactionPrepareThrowsException = false;
bool transactionPrepared = false;
std::function<void()> onTransactionPrepareFn = []() {};
void onUnpreparedTransactionCommit(OperationContext* opCtx,
- const std::vector<repl::ReplOperation>& statements) override;
+ std::vector<repl::ReplOperation>* statements,
+ size_t numberOfPreImagesToWrite) override;
bool onUnpreparedTransactionCommitThrowsException = false;
bool unpreparedTransactionCommitted = false;
std::function<void(const std::vector<repl::ReplOperation>&)> onUnpreparedTransactionCommitFn =
@@ -142,9 +144,11 @@ public:
void OpObserverMock::onTransactionPrepare(OperationContext* opCtx,
const std::vector<OplogSlot>& reservedSlots,
- std::vector<repl::ReplOperation>& statements) {
+ std::vector<repl::ReplOperation>* statements,
+ size_t numberOfPreImagesToWrite) {
ASSERT_TRUE(opCtx->lockState()->inAWriteUnitOfWork());
- OpObserverNoop::onTransactionPrepare(opCtx, reservedSlots, statements);
+ OpObserverNoop::onTransactionPrepare(
+ opCtx, reservedSlots, statements, numberOfPreImagesToWrite);
uassert(ErrorCodes::OperationFailed,
"onTransactionPrepare() failed",
@@ -153,18 +157,19 @@ void OpObserverMock::onTransactionPrepare(OperationContext* opCtx,
onTransactionPrepareFn();
}
-void OpObserverMock::onUnpreparedTransactionCommit(
- OperationContext* opCtx, const std::vector<repl::ReplOperation>& statements) {
+void OpObserverMock::onUnpreparedTransactionCommit(OperationContext* opCtx,
+ std::vector<repl::ReplOperation>* statements,
+ size_t numberOfPreImagesToWrite) {
ASSERT(opCtx->lockState()->inAWriteUnitOfWork());
- OpObserverNoop::onUnpreparedTransactionCommit(opCtx, statements);
+ OpObserverNoop::onUnpreparedTransactionCommit(opCtx, statements, numberOfPreImagesToWrite);
uassert(ErrorCodes::OperationFailed,
"onUnpreparedTransactionCommit() failed",
!onUnpreparedTransactionCommitThrowsException);
unpreparedTransactionCommitted = true;
- onUnpreparedTransactionCommitFn(statements);
+ onUnpreparedTransactionCommitFn(*statements);
}
void OpObserverMock::onPreparedTransactionCommit(