summaryrefslogtreecommitdiff
path: root/src/mongo/db/transaction/transaction_participant.cpp
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2023-04-19 19:34:24 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-21 15:59:17 +0000
commit36da7a04268bcd8ba8b0e458270eb2b44aa7cbb9 (patch)
tree8a8208b4fe0a0ca751833fdd12dde0c48443eb0a /src/mongo/db/transaction/transaction_participant.cpp
parent8b7797e92d5e2ffc5c96904ab34221b8d5460f70 (diff)
downloadmongo-36da7a04268bcd8ba8b0e458270eb2b44aa7cbb9.tar.gz
SERVER-67289 Remove feature flag for PM-2218
Diffstat (limited to 'src/mongo/db/transaction/transaction_participant.cpp')
-rw-r--r--src/mongo/db/transaction/transaction_participant.cpp39
1 files changed, 15 insertions, 24 deletions
diff --git a/src/mongo/db/transaction/transaction_participant.cpp b/src/mongo/db/transaction/transaction_participant.cpp
index b900979115c..9fb12eddbc3 100644
--- a/src/mongo/db/transaction/transaction_participant.cpp
+++ b/src/mongo/db/transaction/transaction_participant.cpp
@@ -1091,10 +1091,6 @@ TransactionParticipant::Participant::onConflictingInternalTransactionCompletion(
void TransactionParticipant::Participant::_setReadSnapshot(OperationContext* opCtx,
repl::ReadConcernArgs readConcernArgs) {
- // (Ignore FCV check): This feature flag doesn't have any upgrade/downgrade concerns.
- bool pitLookupFeatureEnabled =
- feature_flags::gPointInTimeCatalogLookups.isEnabledAndIgnoreFCVUnsafe();
-
if (readConcernArgs.getArgsAtClusterTime()) {
// Read concern code should have already set the timestamp on the recovery unit.
const auto readTimestamp = readConcernArgs.getArgsAtClusterTime()->asTimestamp();
@@ -1125,28 +1121,23 @@ void TransactionParticipant::Participant::_setReadSnapshot(OperationContext* opC
opCtx->recoveryUnit()->setTimestampReadSource(RecoveryUnit::ReadSource::kNoTimestamp);
}
-
- if (pitLookupFeatureEnabled) {
- // Allocate the snapshot together with a consistent CollectionCatalog instance. As we have
- // no critical section we use optimistic concurrency control and check that there was no
- // write to the CollectionCatalog while we allocated the storage snapshot. Stash the catalog
- // instance so collection lookups within this transaction are consistent with the snapshot.
- auto catalog = CollectionCatalog::get(opCtx);
- while (true) {
- opCtx->recoveryUnit()->preallocateSnapshot();
- auto after = CollectionCatalog::get(opCtx);
- if (catalog == after) {
- // Catalog did not change, break out of the retry loop and use this instance
- break;
- }
- // Catalog change detected, reallocate the snapshot and try again.
- opCtx->recoveryUnit()->abandonSnapshot();
- catalog = std::move(after);
- }
- CollectionCatalog::stash(opCtx, std::move(catalog));
- } else {
+ // Allocate the snapshot together with a consistent CollectionCatalog instance. As we have no
+ // critical section we use optimistic concurrency control and check that there was no write to
+ // the CollectionCatalog while we allocated the storage snapshot. Stash the catalog instance so
+ // collection lookups within this transaction are consistent with the snapshot.
+ auto catalog = CollectionCatalog::get(opCtx);
+ while (true) {
opCtx->recoveryUnit()->preallocateSnapshot();
+ auto after = CollectionCatalog::get(opCtx);
+ if (catalog == after) {
+ // Catalog did not change, break out of the retry loop and use this instance
+ break;
+ }
+ // Catalog change detected, reallocate the snapshot and try again.
+ opCtx->recoveryUnit()->abandonSnapshot();
+ catalog = std::move(after);
}
+ CollectionCatalog::stash(opCtx, std::move(catalog));
}
TransactionParticipant::OplogSlotReserver::OplogSlotReserver(OperationContext* opCtx,