summaryrefslogtreecommitdiff
path: root/src/mongo/db/db_raii.cpp
diff options
context:
space:
mode:
authorWilliam Schultz <william.schultz@mongodb.com>2019-04-08 13:56:25 -0400
committerWilliam Schultz <william.schultz@mongodb.com>2019-04-08 13:56:25 -0400
commit73e719a1ee1c174a3131e19b537b3ae8aa958dad (patch)
treeed1ec4e4fa5db461c448f6b9283cb884cdb17fd1 /src/mongo/db/db_raii.cpp
parentac77a440f9df976234c2fe92c6726348e592ca8d (diff)
downloadmongo-73e719a1ee1c174a3131e19b537b3ae8aa958dad.tar.gz
SERVER-39660 Move readSource re-definition to a clearer location in AutoGetCollectionForRead
Diffstat (limited to 'src/mongo/db/db_raii.cpp')
-rw-r--r--src/mongo/db/db_raii.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/db_raii.cpp b/src/mongo/db/db_raii.cpp
index 7aa79365197..d4d876e4214 100644
--- a/src/mongo/db/db_raii.cpp
+++ b/src/mongo/db/db_raii.cpp
@@ -147,6 +147,7 @@ AutoGetCollectionForRead::AutoGetCollectionForRead(OperationContext* opCtx,
if (readAtLastAppliedTimestamp) {
opCtx->recoveryUnit()->setTimestampReadSource(RecoveryUnit::ReadSource::kLastApplied);
+ readSource = opCtx->recoveryUnit()->getTimestampReadSource();
}
// This timestamp could be earlier than the timestamp seen when the transaction is opened
@@ -160,7 +161,6 @@ AutoGetCollectionForRead::AutoGetCollectionForRead(OperationContext* opCtx,
return;
}
- readSource = opCtx->recoveryUnit()->getTimestampReadSource();
invariant(lastAppliedTimestamp ||
readSource == RecoveryUnit::ReadSource::kMajorityCommitted);
invariant(readConcernLevel != repl::ReadConcernLevel::kSnapshotReadConcern);