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/index_build_entry_helpers.cpp | |
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/index_build_entry_helpers.cpp')
-rw-r--r-- | src/mongo/db/index_build_entry_helpers.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/index_build_entry_helpers.cpp b/src/mongo/db/index_build_entry_helpers.cpp index da3f43b29e2..fc689873f6e 100644 --- a/src/mongo/db/index_build_entry_helpers.cpp +++ b/src/mongo/db/index_build_entry_helpers.cpp @@ -254,7 +254,8 @@ Status removeIndexBuildEntry(OperationContext* opCtx, UUID indexBuildUUID) { StatusWith<IndexBuildEntry> getIndexBuildEntry(OperationContext* opCtx, UUID indexBuildUUID) { // Read the most up to date data. - ReadSourceScope readSourceScope(opCtx, RecoveryUnit::ReadSource::kNoTimestamp); + invariant(RecoveryUnit::ReadSource::kNoTimestamp == + opCtx->recoveryUnit()->getTimestampReadSource()); AutoGetCollectionForRead autoCollection(opCtx, NamespaceString::kIndexBuildEntryNamespace); const Collection* collection = autoCollection.getCollection(); |