As a diagnostic tool, the LockManager::dump() function, when invoked through an attached debugger, logs a list of acquired and enqueued locks. The lockInfo command also performs a similar function through the shell/client interface, but with additional information on the Client/OperationContext objects associated with each granted/pending lock request. Since the LockManager::dump() function is used more widely as part of the shutdown procedure for stalled test runs in our CI system, it would improve diagnostics to also include the Client/OpCtx information in the logs() when dumping the lock manager's internal state through the debugger.
Sample output:
Dumping LockManager @ 0x10e62e590 Lock @ 0x7F891DD23920: {2305843009213693953: ParallelBatchWriterMode, 1} GRANTED: LockRequest 223 @ 0x7F892E87CE00: Mode = X; Thread = 0x70000b7e0000 | 0x70000b7e0000; ConvertMode = NONE; EnqueueAtFront = 1; CompatibleFirst = 1; DebugInfo = ; ClientInfo = { desc: "rsSync-0", opid: 220 } PENDING: LockRequest 240 @ 0x7F88FE074000: Mode = IS; Thread = 0x70000c5b1000 | 0x70000c5b1000; ConvertMode = NONE; EnqueueAtFront = 0; CompatibleFirst = 0; DebugInfo = ; ClientInfo = { desc: "conn12", connectionId: 12, client: "127.0.0.1:56489", opid: 236 } -----------------------------------------------------------
Sample output with command information:
Dumping LockManager @ 0x111458590 Lock @ 0x7F8654D230E0: {2305843009213693953: ParallelBatchWriterMode, 1} GRANTED: LockRequest 248 @ 0x7F865580DC00: Mode = X; Thread = 0x70000eca3000 | 0x70000eca3000; ConvertMode = NONE; EnqueueAtFront = 1; CompatibleFirst = 1; DebugInfo = ; ClientInfo = { desc: "rsSync-0", opid: 245 } PENDING: LockRequest 265 @ 0x7F8656801E00: Mode = IS; Thread = 0x70000fa74000 | 0x70000fa74000; ConvertMode = NONE; EnqueueAtFront = 0; CompatibleFirst = 0; DebugInfo = { listDatabases: 1.0, lsid: { id: UUID("78521e0f-7d7e-40ba-a7fc-44d2d2813ebc") }, $clusterTime: { clusterTime: Timestamp(1570622648, 2), signature: { hash: BinData(0, 0000000000000000000000000000000000000000), keyId: 0 } }, $readPreference: { mode: "secondaryPreferred" }, $db: "admin" }; ClientInfo = { desc: "conn12", connectionId: 12, client: "127.0.0.1:56358", opid: 261 } -----------------------------------------------------------
- causes
-
SERVER-45831 [4.0] Performance regression processing large aggregation commands
- Closed
- is related to
-
SERVER-16203 Add command to dump lock manager state
- Closed
-
SERVER-39860 Separate reporting of RSTL and PBWM locks metrics in serverStatus and currentOp
- Closed
-
SERVER-37406 A stashed Locker should keep information about the owning transaction
- Closed
-
SERVER-39902 lockInfo should use UUIDCatalog to map resourceIds to collection names
- Closed
-
SERVER-40915 Show view namespaces in the LockManager's ResourceId::toString() function
- Closed
-
SERVER-40780 LockManager dump should show the name of global resources
- Closed
- related to
-
SERVER-45012 Add transaction information to lockInfo
- Closed