[SERVER-45556] Create GDB pretty printer to dump all active RecoveryUnits Created: 14/Jan/20  Updated: 29/Oct/23  Resolved: 04/May/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.4.0

Type: Improvement Priority: Major - P3
Reporter: Louis Williams Assignee: James Heppenstall
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-52956 Add storage debug method to dump syst... Closed
Related
related to SERVER-60985 include WT_SESSION pointer in GDB pre... Closed
related to SERVER-61177 Create GDB command to dump WiredTiger... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2020-05-04, Execution Team 2020-05-18
Participants:
Linked BF Score: 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   



 Comments   
Comment by Githook User [ 04/May/20 ]

Author:

{'name': 'Jamie Heppenstall', 'email': 'jamie.heppenstall@mongodb.com', 'username': 'JamesHeppenstall'}

Message: SERVER-45556 Create GDB command to dump all active RecoveryUnits
Branch: master
https://github.com/mongodb/mongo/commit/e722138cbd1a148c76f0d372b5d948dfcedc0e84

Generated at Thu Feb 08 05:09:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.