summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/transaction_oplog_application.cpp
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@10gen.com>2019-04-16 14:19:00 -0400
committerMatthew Russotto <matthew.russotto@10gen.com>2019-04-16 17:00:20 -0400
commitc8bf694e5ede3bbc95c9b07471ef034c9761a378 (patch)
treee170f0ec14ca48d41a1bf5325dc0d27f4b6fecd6 /src/mongo/db/repl/transaction_oplog_application.cpp
parent22578319a59e898dc67d7de88531a5c23f2273ce (diff)
downloadmongo-c8bf694e5ede3bbc95c9b07471ef034c9761a378.tar.gz
SERVER-39791 Reconstruct prepared transactions from new oplog format on rollback
Diffstat (limited to 'src/mongo/db/repl/transaction_oplog_application.cpp')
-rw-r--r--src/mongo/db/repl/transaction_oplog_application.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/repl/transaction_oplog_application.cpp b/src/mongo/db/repl/transaction_oplog_application.cpp
index 71905e5e4b1..b247144b3df 100644
--- a/src/mongo/db/repl/transaction_oplog_application.cpp
+++ b/src/mongo/db/repl/transaction_oplog_application.cpp
@@ -278,7 +278,11 @@ namespace {
Status _applyPrepareTransaction(OperationContext* opCtx,
const OplogEntry& entry,
repl::OplogApplication::Mode oplogApplicationMode) {
- auto ops = readTransactionOperationsFromOplogChain(opCtx, entry, {});
+
+ auto ops = [&] {
+ ReadSourceScope readSourceScope(opCtx);
+ return readTransactionOperationsFromOplogChain(opCtx, entry, {});
+ }();
if (oplogApplicationMode == repl::OplogApplication::Mode::kRecovering) {
// We might replay a prepared transaction behind oldest timestamp. Note that since this is