summaryrefslogtreecommitdiff
path: root/src/mongo/db/concurrency
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2023-02-21 23:06:04 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-26 22:02:09 +0000
commit728500f59d1a6be4fd95b8ffa7d3c7dd122b25be (patch)
tree4cdad6c26d4ab2290e18cf77f11824a1d0144ac6 /src/mongo/db/concurrency
parent4fa82ec65ce017b254a14cecafb0ac97bdcb141e (diff)
downloadmongo-728500f59d1a6be4fd95b8ffa7d3c7dd122b25be.tar.gz
SERVER-73112 Avoid constructing global namespaces directly
Diffstat (limited to 'src/mongo/db/concurrency')
-rw-r--r--src/mongo/db/concurrency/lock_manager_defs.cpp2
-rw-r--r--src/mongo/db/concurrency/lock_manager_defs.h1
-rw-r--r--src/mongo/db/concurrency/lock_stats.h2
3 files changed, 1 insertions, 4 deletions
diff --git a/src/mongo/db/concurrency/lock_manager_defs.cpp b/src/mongo/db/concurrency/lock_manager_defs.cpp
index af7fbb2e3c2..a437d3b5964 100644
--- a/src/mongo/db/concurrency/lock_manager_defs.cpp
+++ b/src/mongo/db/concurrency/lock_manager_defs.cpp
@@ -34,8 +34,6 @@ namespace mongo {
// Hardcoded resource IDs.
const ResourceId resourceIdLocalDB =
ResourceId(RESOURCE_DATABASE, DatabaseName(boost::none, "local"));
-const ResourceId resourceIdOplog =
- ResourceId(RESOURCE_COLLECTION, NamespaceString(boost::none, "local.oplog.rs"));
const ResourceId resourceIdAdminDB =
ResourceId(RESOURCE_DATABASE, DatabaseName(boost::none, "admin"));
const ResourceId resourceIdGlobal =
diff --git a/src/mongo/db/concurrency/lock_manager_defs.h b/src/mongo/db/concurrency/lock_manager_defs.h
index 889efa3b92b..026af0b28f4 100644
--- a/src/mongo/db/concurrency/lock_manager_defs.h
+++ b/src/mongo/db/concurrency/lock_manager_defs.h
@@ -328,7 +328,6 @@ typedef uint64_t LockerId;
// Hardcoded resource id for the oplog collection, which is special-cased both for resource
// acquisition purposes and for statistics reporting.
extern const ResourceId resourceIdLocalDB;
-extern const ResourceId resourceIdOplog;
// Hardcoded resource id for admin db. This is to ensure direct writes to auth collections
// are serialized (see SERVER-16092)
diff --git a/src/mongo/db/concurrency/lock_stats.h b/src/mongo/db/concurrency/lock_stats.h
index 69855480393..de15f26d4e7 100644
--- a/src/mongo/db/concurrency/lock_stats.h
+++ b/src/mongo/db/concurrency/lock_stats.h
@@ -137,7 +137,7 @@ public:
}
LockStatCountersType& get(ResourceId resId, LockMode mode) {
- if (resId == resourceIdOplog) {
+ if (resId == ResourceId(RESOURCE_COLLECTION, NamespaceString::kRsOplogNamespace)) {
return _oplogStats.modeStats[mode];
}