summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPol Pinol Castuera <pol.pinol@mongodb.com>2023-04-12 11:56:27 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-12 12:19:07 +0000
commit4936d07dc233aff1529456527a1efc950cd85d61 (patch)
tree6b1ac3930d245787849cd3c23f3f53ed13a9db1c
parentd2652fd6b67f9f6e03cc45b4a00b3a99a804058b (diff)
downloadmongo-4936d07dc233aff1529456527a1efc950cd85d61.tar.gz
SERVER-74720 The default 'shardingStatistics' serverStatus section takes locks
(partially cherry picked from commit f18e1f8b2d5f5988fa7c6e18e343c9c85589bae9)
-rw-r--r--src/mongo/db/s/sharding_server_status.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/s/sharding_server_status.cpp b/src/mongo/db/s/sharding_server_status.cpp
index c431ee4a876..52a31c00920 100644
--- a/src/mongo/db/s/sharding_server_status.cpp
+++ b/src/mongo/db/s/sharding_server_status.cpp
@@ -127,7 +127,7 @@ public:
// `config.collections` collection. This count must only be appended when serverStatus is
// invoked on the config server.
if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) {
- AutoGetCollectionForRead autoColl(opCtx, CollectionType::ConfigNS);
+ AutoGetCollectionForReadMaybeLockFree autoColl(opCtx, CollectionType::ConfigNS);
const auto& collection = autoColl.getCollection();
const auto numShardedCollections = collection ? collection->numRecords(opCtx) : 0;
result.append("numShardedCollections", numShardedCollections);