diff options
author | jannaerin <golden.janna@gmail.com> | 2023-02-21 23:06:04 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-26 22:02:09 +0000 |
commit | 728500f59d1a6be4fd95b8ffa7d3c7dd122b25be (patch) | |
tree | 4cdad6c26d4ab2290e18cf77f11824a1d0144ac6 /src/mongo/db/free_mon | |
parent | 4fa82ec65ce017b254a14cecafb0ac97bdcb141e (diff) | |
download | mongo-728500f59d1a6be4fd95b8ffa7d3c7dd122b25be.tar.gz |
SERVER-73112 Avoid constructing global namespaces directly
Diffstat (limited to 'src/mongo/db/free_mon')
-rw-r--r-- | src/mongo/db/free_mon/free_mon_mongod.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/free_mon/free_mon_storage.cpp | 10 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/mongo/db/free_mon/free_mon_mongod.cpp b/src/mongo/db/free_mon/free_mon_mongod.cpp index 0d973c16197..bf247415dc8 100644 --- a/src/mongo/db/free_mon/free_mon_mongod.cpp +++ b/src/mongo/db/free_mon/free_mon_mongod.cpp @@ -293,7 +293,7 @@ void registerCollectors(FreeMonController* controller) { "replSetGetConfig", "replSetGetConfig", "", BSON("replSetGetConfig" << 1))); // Collect UUID for certain collections. - std::set<NamespaceString> namespaces({NamespaceString("local.oplog.rs")}); + std::set<NamespaceString> namespaces({NamespaceString::kRsOplogNamespace}); controller->addRegistrationCollector( std::make_unique<FreeMonNamespaceUUIDCollector>(namespaces)); controller->addMetricsCollector( diff --git a/src/mongo/db/free_mon/free_mon_storage.cpp b/src/mongo/db/free_mon/free_mon_storage.cpp index 5d20eee1e23..7c1fcd7858d 100644 --- a/src/mongo/db/free_mon/free_mon_storage.cpp +++ b/src/mongo/db/free_mon/free_mon_storage.cpp @@ -42,13 +42,6 @@ namespace mongo { -namespace { - -// mms-automation stores its document in local.clustermanager -static const NamespaceString localClusterManagerNss("local.clustermanager"); - -} // namespace - constexpr StringData FreeMonStorage::kFreeMonDocIdKey; boost::optional<FreeMonStorageState> FreeMonStorage::read(OperationContext* opCtx) { @@ -124,7 +117,8 @@ boost::optional<BSONObj> FreeMonStorage::readClusterManagerState(OperationContex AutoGetCollectionForRead autoRead(opCtx, NamespaceString::kServerConfigurationNamespace); - auto swObj = storageInterface->findSingleton(opCtx, localClusterManagerNss); + auto swObj = + storageInterface->findSingleton(opCtx, NamespaceString::kLocalClusterManagerNamespace); if (!swObj.isOK()) { // Ignore errors about not-finding documents or having too many documents if (swObj.getStatus() == ErrorCodes::NamespaceNotFound || |