summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/do_txn_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/do_txn_test.cpp')
-rw-r--r--src/mongo/db/repl/do_txn_test.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/repl/do_txn_test.cpp b/src/mongo/db/repl/do_txn_test.cpp
index abede66d1f6..922a7f615fa 100644
--- a/src/mongo/db/repl/do_txn_test.cpp
+++ b/src/mongo/db/repl/do_txn_test.cpp
@@ -40,6 +40,7 @@
#include "mongo/db/repl/repl_client_info.h"
#include "mongo/db/repl/replication_coordinator_mock.h"
#include "mongo/db/repl/storage_interface_impl.h"
+#include "mongo/db/repl/storage_interface_mock.h"
#include "mongo/db/s/op_observer_sharding_impl.h"
#include "mongo/db/service_context_d_test_fixture.h"
#include "mongo/db/session_catalog_mongod.h"
@@ -152,6 +153,11 @@ void DoTxnTest::setUp() {
// collections.
_storage = stdx::make_unique<StorageInterfaceImpl>();
+ // We also need to give replication a StorageInterface for checking out the transaction.
+ // The test storage engine doesn't support the necessary call (getPointInTimeReadTimestamp()),
+ // so we use a mock.
+ repl::StorageInterface::set(service, stdx::make_unique<StorageInterfaceMock>());
+
// Set up the transaction and session.
_opCtx->setLogicalSessionId(makeLogicalSessionIdForTest());
_opCtx->setTxnNumber(0); // TxnNumber can always be 0 because we have a new session.