summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatt Kneiser <matt.kneiser@mongodb.com>2023-04-11 13:34:49 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-20 15:33:03 +0000
commite801746a73135b6fa766c2567b31c0aaafeb0043 (patch)
tree2186343a60279e599f691274f9857931b107d9b3 /src
parent43b44a1f0001f238d3162be23a56f76de7cf88cc (diff)
downloadmongo-e801746a73135b6fa766c2567b31c0aaafeb0043.tar.gz
SERVER-75799 Re-insert locks into lock-free dbhash
(cherry picked from commit a2722330e5a975b9692e69f744a9769006ff94ea)
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/commands/dbhash.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mongo/db/commands/dbhash.cpp b/src/mongo/db/commands/dbhash.cpp
index 312b513de88..01ac594fe80 100644
--- a/src/mongo/db/commands/dbhash.cpp
+++ b/src/mongo/db/commands/dbhash.cpp
@@ -253,13 +253,10 @@ public:
boost::optional<AutoGetDb> autoDb;
if (isPointInTimeRead) {
- // (Ignore FCV check): This feature flag doesn't have any upgrade/downgrade concerns.
- if (!feature_flags::gPointInTimeCatalogLookups.isEnabledAndIgnoreFCVUnsafe()) {
- // We only need to lock the database in intent mode and then collection in intent
- // mode as well to ensure that none of the collections get dropped. This is no
- // longer necessary with point-in-time catalog lookups.
- autoDb.emplace(opCtx, dbName, MODE_IS);
- }
+ // We only need to lock the database in intent mode and then collection in intent
+ // mode as well to ensure that none of the collections get dropped.
+ // TODO:SERVER-75848 Make this lock-free
+ autoDb.emplace(opCtx, dbName, MODE_IS);
} else {
// We lock the entire database in S-mode in order to ensure that the contents will not
// change for the snapshot when not reading at a timestamp.
@@ -351,6 +348,8 @@ public:
!minSnapshot || *readTimestamp >= *minSnapshot);
}
} else {
+ // TODO:SERVER-75848 Make this lock-free
+ Lock::CollectionLock clk(opCtx, *nss, MODE_IS);
coll = catalog->establishConsistentCollection(
opCtx,
{dbName, uuid},