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

Create GDB pretty printer to dump all active RecoveryUnits

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.4.0
    • None
    • None
    • Fully Compatible
    • Execution Team 2020-05-04, Execution Team 2020-05-18
    • 13

    Description

      I wrote a script to dump all RecoveryUnit states for all Clients in GDB, but it would be better (and I believe faster) to implement this as a proper printer in Python. The most challenging part of doing this manually from the debugger is traversing the Abseil hash set, but there is an existing utility function in our printers that would make this script even easier to implement in Python.

      define mongo_dump_txns
              set $client_set = $arg0->_clients
              set $capacity = $client_set.capacity_
              set $ctrl = $client_set.ctrl_
              set $i = 0 
              while ($i < $capacity)      
                  if ($ctrl[$i] >= 0)
                      set $client = (mongo::Client*) *$client_set.slots_[$i]
                      print $client
                      print $client->_desc
                      if ($client->_opCtx != 0)
                          print $client->_opCtx
                          print *(WiredTigerRecoveryUnit*)$client->_opCtx->_recoveryUnit
                      end
                  end
                  set $i = $i + 1 
              end     
      end   
      

      Attachments

        Issue Links

          Activity

            People

              james.heppenstall@mongodb.com James Heppenstall
              louis.williams@mongodb.com Louis Williams
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: