summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/transaction_oplog_application.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/transaction_oplog_application.cpp')
-rw-r--r--src/mongo/db/repl/transaction_oplog_application.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mongo/db/repl/transaction_oplog_application.cpp b/src/mongo/db/repl/transaction_oplog_application.cpp
index 0c7a1f0727b..67fb840de64 100644
--- a/src/mongo/db/repl/transaction_oplog_application.cpp
+++ b/src/mongo/db/repl/transaction_oplog_application.cpp
@@ -262,8 +262,9 @@ std::pair<std::vector<OplogEntry>, bool> _readTransactionOperationsFromOplogChai
const std::vector<OplogEntry*>& cachedOps,
const bool checkForCommands) noexcept {
bool isTransactionWithCommand = false;
- // Traverse the oplog chain with its own snapshot and read timestamp.
- ReadSourceScope readSourceScope(opCtx);
+ // Ensure future transactions read without a timestamp.
+ invariant(RecoveryUnit::ReadSource::kNoTimestamp ==
+ opCtx->recoveryUnit()->getTimestampReadSource());
std::vector<OplogEntry> ops;
@@ -538,11 +539,10 @@ void reconstructPreparedTransactions(OperationContext* opCtx, repl::OplogApplica
LOGV2(21848, "Hit skipReconstructPreparedTransactions failpoint");
return;
}
- // Read the transactions table and the oplog collection without a timestamp.
- // The below DBDirectClient read uses AutoGetCollectionForRead which could implicitly change the
- // read source. So we need to explicitly set the read source to kNoTimestamp to force reads in
- // this scope to be untimestamped.
- ReadSourceScope readSourceScope(opCtx, RecoveryUnit::ReadSource::kNoTimestamp);
+
+ // Ensure future transactions read without a timestamp.
+ invariant(RecoveryUnit::ReadSource::kNoTimestamp ==
+ opCtx->recoveryUnit()->getTimestampReadSource());
DBDirectClient client(opCtx);
const auto cursor = client.query(NamespaceString::kSessionTransactionsTableNamespace,