diff options
author | Dianna Hohensee <dianna.hohensee@mongodb.com> | 2020-05-11 15:55:58 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-05-14 22:17:25 +0000 |
commit | aebf6a5d01a28c7d5a3a4ee68d11c2e150291131 (patch) | |
tree | d9245faa82d7a1482b1b1c978b757d7eaeb38571 /src/mongo/db/query/find.cpp | |
parent | 9d8eb69d583b89682520ec58595e558d5f6cc9a2 (diff) | |
download | mongo-aebf6a5d01a28c7d5a3a4ee68d11c2e150291131.tar.gz |
SERVER-47803 Move the database level profile setting from Database into CollectionCatalog
Diffstat (limited to 'src/mongo/db/query/find.cpp')
-rw-r--r-- | src/mongo/db/query/find.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp index 87a85b628d4..5e28db4d8c8 100644 --- a/src/mongo/db/query/find.cpp +++ b/src/mongo/db/query/find.cpp @@ -296,14 +296,11 @@ Message getMore(OperationContext* opCtx, if (cursorPin->lockPolicy() == ClientCursorParams::LockPolicy::kLocksInternally) { if (!nss.isCollectionlessCursorNamespace()) { AutoGetDb autoDb(opCtx, nss.db(), MODE_IS); - const auto profilingLevel = autoDb.getDb() - ? boost::optional<int>{autoDb.getDb()->getProfilingLevel()} - : boost::none; statsTracker.emplace(opCtx, nss, Top::LockType::NotLocked, AutoStatsTracker::LogMode::kUpdateTopAndCurOp, - profilingLevel); + CollectionCatalog::get(opCtx).getDatabaseProfileLevel(nss.db())); auto view = autoDb.getDb() ? ViewCatalog::get(autoDb.getDb())->lookup(opCtx, nss.ns()) : nullptr; uassert( @@ -316,13 +313,11 @@ Message getMore(OperationContext* opCtx, } } else { readLock.emplace(opCtx, nss); - const int doNotChangeProfilingLevel = 0; statsTracker.emplace(opCtx, nss, Top::LockType::ReadLocked, AutoStatsTracker::LogMode::kUpdateTopAndCurOp, - readLock->getDb() ? readLock->getDb()->getProfilingLevel() - : doNotChangeProfilingLevel); + CollectionCatalog::get(opCtx).getDatabaseProfileLevel(nss.db())); // This checks to make sure the operation is allowed on a replicated node. Since we are not // passing in a query object (necessary to check SlaveOK query option), we allow reads |