summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/dbcommands_d.cpp
diff options
context:
space:
mode:
authorSophia Tan <sophia_tll@hotmail.com>2022-05-18 19:41:20 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-19 18:19:03 +0000
commitb065a3b04ab6c14b7a695f0c3f97eaa81b202a36 (patch)
treeaacf818dfbefcc6953a9db5da6db6b0ac54983a5 /src/mongo/db/commands/dbcommands_d.cpp
parenteb90659062d8ac2dfd629b5d672c67423bddaa6a (diff)
downloadmongo-b065a3b04ab6c14b7a695f0c3f97eaa81b202a36.tar.gz
SERVER-63109 Change CollectionCatalog::_databaseProfileSettings to be keyed by DatabaseName
Diffstat (limited to 'src/mongo/db/commands/dbcommands_d.cpp')
-rw-r--r--src/mongo/db/commands/dbcommands_d.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mongo/db/commands/dbcommands_d.cpp b/src/mongo/db/commands/dbcommands_d.cpp
index 51f03ce67ba..7512ed32615 100644
--- a/src/mongo/db/commands/dbcommands_d.cpp
+++ b/src/mongo/db/commands/dbcommands_d.cpp
@@ -102,7 +102,7 @@ MONGO_FAIL_POINT_DEFINE(waitInFilemd5DuringManualYield);
Status _setProfileSettings(OperationContext* opCtx,
Database* db,
- StringData dbName,
+ const DatabaseName& dbName,
mongo::CollectionCatalog::ProfileSettings newSettings) {
invariant(db);
@@ -150,7 +150,7 @@ public:
protected:
CollectionCatalog::ProfileSettings _applyProfilingLevel(
OperationContext* opCtx,
- const std::string& dbName,
+ const DatabaseName& dbName,
const ProfileCmdRequest& request) const final {
const auto profilingLevel = request.getCommandParameter();
@@ -168,7 +168,7 @@ protected:
// Accessing system.profile collection should not conflict with oplog application.
ShouldNotConflictWithSecondaryBatchApplicationBlock shouldNotConflictBlock(
opCtx->lockState());
- AutoGetDb ctx(opCtx, dbName, dbMode);
+ AutoGetDb ctx(opCtx, dbName.db(), dbMode);
Database* db = ctx.getDb();
// Fetches the database profiling level + filter or the server default if the db does not
@@ -180,9 +180,7 @@ protected:
// When setting the profiling level, create the database if it didn't already exist.
// When just reading the profiling level, we do not create the database.
auto databaseHolder = DatabaseHolder::get(opCtx);
- // TODO SERVER-63109 Make _setProfileSettings pass DatabaseName.
- const DatabaseName tenantDbName(boost::none, dbName);
- db = databaseHolder->openDb(opCtx, tenantDbName);
+ db = databaseHolder->openDb(opCtx, dbName);
}
auto newSettings = oldSettings;