summaryrefslogtreecommitdiff
path: root/src/mongo/db/db_raii.cpp
diff options
context:
space:
mode:
authorAntonio Fuschetto <antonio.fuschetto@mongodb.com>2022-07-06 15:23:35 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-07-06 16:29:58 +0000
commit0cf9395eb2274290a3787d088ec88d7b1c7c3a77 (patch)
tree63b5dfe873cba75f925e05bea08eec3f638cf810 /src/mongo/db/db_raii.cpp
parent57a8561e7754cca2875f886bf8780e2b7940dba2 (diff)
downloadmongo-0cf9395eb2274290a3787d088ec88d7b1c7c3a77.tar.gz
SERVER-64209 Push the DatabaseShardingState state to the Storage Catalog
Diffstat (limited to 'src/mongo/db/db_raii.cpp')
-rw-r--r--src/mongo/db/db_raii.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mongo/db/db_raii.cpp b/src/mongo/db/db_raii.cpp
index 688577f8e28..86490bc9e36 100644
--- a/src/mongo/db/db_raii.cpp
+++ b/src/mongo/db/db_raii.cpp
@@ -32,6 +32,7 @@
#include "mongo/db/db_raii.h"
+#include "mongo/db/catalog/catalog_helper.h"
#include "mongo/db/catalog/collection_catalog.h"
#include "mongo/db/catalog/database_holder.h"
#include "mongo/db/concurrency/locker.h"
@@ -1003,9 +1004,7 @@ AutoGetDbForReadLockFree::AutoGetDbForReadLockFree(OperationContext* opCtx,
// Note: this must always be checked, regardless of whether the collection exists, so
// that the dbVersion of this node or the caller gets updated quickly in case either is
// stale.
- auto dss = DatabaseShardingState::getSharedForLockFreeReads(opCtx, dbName);
- auto dssLock = DatabaseShardingState::DSSLock::lockShared(opCtx, dss.get());
- dss->checkDbVersion(opCtx, dssLock);
+ catalog_helper::assertMatchingDbVersion(opCtx, dbName);
return std::make_pair(&fakeColl, /* isView */ false);
},
/* ResetFunc */