diff options
author | Louis Williams <louis.williams@mongodb.com> | 2020-05-12 13:39:31 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-05-12 18:03:48 +0000 |
commit | 25c694f365db0f07a445bd17b6cd5cbf32f5f2f9 (patch) | |
tree | c90451e347838f428b8cad851531b42c42cce6fa /src/mongo/db/repl/transaction_oplog_application.cpp | |
parent | e2602ad053b2120982fbcac8e33e1ad64e6ec30a (diff) | |
download | mongo-25c694f365db0f07a445bd17b6cd5cbf32f5f2f9.tar.gz |
SERVER-46721 Secondary readers should read at the no-overlap time instead of lastApplied
The no-overlap time, ReadSource::kNoOverlap, is the minimum of replication's lastApplied timestamp
and WiredTiger's all_durable time. This time is independent of replication state and ensures
queries do not see oplog holes after state transitions from secondary to primary.
Diffstat (limited to 'src/mongo/db/repl/transaction_oplog_application.cpp')
-rw-r--r-- | src/mongo/db/repl/transaction_oplog_application.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/repl/transaction_oplog_application.cpp b/src/mongo/db/repl/transaction_oplog_application.cpp index b9f75c07d1a..8608926919c 100644 --- a/src/mongo/db/repl/transaction_oplog_application.cpp +++ b/src/mongo/db/repl/transaction_oplog_application.cpp @@ -512,8 +512,8 @@ void reconstructPreparedTransactions(OperationContext* opCtx, repl::OplogApplica } // Read the transactions table and the oplog collection without a timestamp. // The below DBDirectClient read uses AutoGetCollectionForRead which could implicitly change the - // read source to kLastApplied. So we need to explicitly set the read source to kNoTimestamp to - // force reads in this scope to be untimestamped. + // 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); DBDirectClient client(opCtx); |