diff options
author | Gregory Noma <gregory.noma@gmail.com> | 2022-01-26 14:14:51 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-01-26 15:07:35 +0000 |
commit | 5954af3fc2c3bfe546f6043254ed84615ffdd068 (patch) | |
tree | dd9c79ec7d6123e7f511ca65cfadcf09d5d3b20c /src/mongo/db/ftdc | |
parent | 53f05f14bf97787451785f1a93c453e650dbb5d0 (diff) | |
download | mongo-5954af3fc2c3bfe546f6043254ed84615ffdd068.tar.gz |
SERVER-62948 Ensure FTDC collectors read without a timestamp
Diffstat (limited to 'src/mongo/db/ftdc')
-rw-r--r-- | src/mongo/db/ftdc/collector.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/db/ftdc/collector.cpp b/src/mongo/db/ftdc/collector.cpp index b8c6aabd454..b6c8e5a081e 100644 --- a/src/mongo/db/ftdc/collector.cpp +++ b/src/mongo/db/ftdc/collector.cpp @@ -70,10 +70,6 @@ std::tuple<BSONObj, Date_t> FTDCCollectorCollection::collect(Client* client) { ShouldNotConflictWithSecondaryBatchApplicationBlock shouldNotConflictBlock(opCtx->lockState()); opCtx->lockState()->skipAcquireTicket(); - // Ensure future transactions read without a timestamp. - invariant(RecoveryUnit::ReadSource::kNoTimestamp == - opCtx->recoveryUnit()->getTimestampReadSource()); - for (auto& collector : _collectors) { // Skip collection if this collector has no data to return if (!collector->hasData()) { @@ -98,6 +94,10 @@ std::tuple<BSONObj, Date_t> FTDCCollectorCollection::collect(Client* client) { end = client->getServiceContext()->getPreciseClockSource()->now(); subObjBuilder.appendDate(kFTDCCollectEndField, end); + + // Ensure the collector did not set a read timestamp. + invariant(opCtx->recoveryUnit()->getTimestampReadSource() == + RecoveryUnit::ReadSource::kNoTimestamp); } builder.appendDate(kFTDCCollectEndField, end); |