summaryrefslogtreecommitdiff
path: root/src/mongo/db/db_raii.cpp
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2019-01-02 16:48:56 -0500
committerLouis Williams <louis.williams@mongodb.com>2019-01-17 11:35:32 -0500
commite12dcc7fdbdb44fb7806dfb42a49bd740f361d82 (patch)
treed23cdd47b52a10b5100598a8f6464febf8ec9b80 /src/mongo/db/db_raii.cpp
parent7edc50cf214893688eb8432619e4a8bba18d107b (diff)
downloadmongo-e12dcc7fdbdb44fb7806dfb42a49bd740f361d82.tar.gz
SERVER-37270 Remove foreground index builds by default
Diffstat (limited to 'src/mongo/db/db_raii.cpp')
-rw-r--r--src/mongo/db/db_raii.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/db_raii.cpp b/src/mongo/db/db_raii.cpp
index f078ccf4966..8555132b7ba 100644
--- a/src/mongo/db/db_raii.cpp
+++ b/src/mongo/db/db_raii.cpp
@@ -164,7 +164,7 @@ AutoGetCollectionForRead::AutoGetCollectionForRead(OperationContext* opCtx,
// the PBWM lock and retry.
if (lastAppliedTimestamp) {
LOG(2) << "Tried reading at last-applied time: " << *lastAppliedTimestamp
- << " on nss: " << nss.ns() << ", but future catalog changes are pending at time "
+ << " on ns: " << nss.ns() << ", but future catalog changes are pending at time "
<< *minSnapshot << ". Trying again without reading at last-applied time.";
// Destructing the block sets _shouldConflictWithSecondaryBatchApplication back to the
// previous value. If the previous value is false (because there is another
@@ -172,6 +172,10 @@ AutoGetCollectionForRead::AutoGetCollectionForRead(OperationContext* opCtx,
// does not take the PBWM lock.
_shouldNotConflictWithSecondaryBatchApplicationBlock = boost::none;
invariant(opCtx->lockState()->shouldConflictWithSecondaryBatchApplication());
+
+ // Cannot change ReadSource while a RecoveryUnit is active, which may result from
+ // calling getPointInTimeReadTimestamp().
+ opCtx->recoveryUnit()->abandonSnapshot();
opCtx->recoveryUnit()->setTimestampReadSource(RecoveryUnit::ReadSource::kUnset);
}