diff options
author | Louis Williams <louis.williams@mongodb.com> | 2020-09-10 12:30:21 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-10 18:15:18 +0000 |
commit | 11c68393df88a6f1ea4855e6ac15e54ca9f9d976 (patch) | |
tree | 893c5bb98404d3dabfa35f017e466345b0a44d80 /src/mongo/db/free_mon | |
parent | ce0487190cf69d200028e7f9f4bcd3cefeea805d (diff) | |
download | mongo-11c68393df88a6f1ea4855e6ac15e54ca9f9d976.tar.gz |
SERVER-48452 Internal readers should default to reading without a timestamp
Removes ReadSource::kUnset in favor of kNoTimestamp as the default
Makes the following behavioral changes to AutoGetCollectionForRead:
* Removes special early-return handling for kNoTimestamp
* Only user or DBDirectClient operations are eligible to read at
kLastApplied.
* Operations only read at kLastApplied when in the SECONDARY state, nothing
else. This means most internal operations that use DBDirectClient do not need
to use a ReadSourceScope to ensure they read at kNoTimestamp.
Diffstat (limited to 'src/mongo/db/free_mon')
-rw-r--r-- | src/mongo/db/free_mon/free_mon_storage.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/free_mon/free_mon_storage.cpp b/src/mongo/db/free_mon/free_mon_storage.cpp index 7c25c6a671c..89be39295e1 100644 --- a/src/mongo/db/free_mon/free_mon_storage.cpp +++ b/src/mongo/db/free_mon/free_mon_storage.cpp @@ -57,6 +57,10 @@ boost::optional<FreeMonStorageState> FreeMonStorage::read(OperationContext* opCt auto storageInterface = repl::StorageInterface::get(opCtx); + // Ensure we read without a timestamp. + invariant(RecoveryUnit::ReadSource::kNoTimestamp == + opCtx->recoveryUnit()->getTimestampReadSource()); + AutoGetCollectionForRead autoRead(opCtx, NamespaceString::kServerConfigurationNamespace); auto swObj = storageInterface->findById( |