-
Type: Task
-
Resolution: Won't Do
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Service Arch
-
Service Arch Prioritized List
We log a message warning users about performing operations via a direct-connection to a shard if we haven't already done so in the last hour. We check if we have logged in the last hour by storing the time we last logged at, protecting access to that time with a global mutex (https://github.com/mongodb/mongo/blob/531c4daba675e1a8a5213af7823ac01bccf0e8f7/src/mongo/db/service_entry_point_common.cpp#L1821-L1833) and checking that time under the mutex (along with taking the current time) on the path of every operation subject to this check.
This static mutex is therefore contended on by every direct-shard-operation thread. I think we can come up with a simpler way to control logging this message that doesn't require a mutex.
- is related to
-
SERVER-88263 Move direct connection warnings to the collection acquisition (and AutoGetCollection)
- Closed