Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-43910

include Client/OpCtx information in LockManager::dump() output

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1, 4.2.3, 4.0.15
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Fully Compatible
    • v4.2, v4.0
    • Execution Team 2019-10-21
    • 0

      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 }
      -----------------------------------------------------------
      

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            benety.goh@mongodb.com Benety Goh
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: