From e12dcc7fdbdb44fb7806dfb42a49bd740f361d82 Mon Sep 17 00:00:00 2001 From: Louis Williams Date: Wed, 2 Jan 2019 16:48:56 -0500 Subject: SERVER-37270 Remove foreground index builds by default --- src/mongo/db/db_raii.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/db_raii.cpp') 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); } -- cgit v1.2.1