[SERVER-38045] Dump session catalog using GDB scripting Created: 08/Nov/18  Updated: 29/Oct/23  Resolved: 11/Dec/18

Status: Closed
Project: Core Server
Component/s: Replication, Testing Infrastructure
Affects Version/s: None
Fix Version/s: 4.1.7

Type: New Feature Priority: Major - P3
Reporter: Siyuan Zhou Assignee: William Schultz (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-28437 Hang analyzer GDB module mongo_lock.p... Closed
related to SERVER-38249 stdx::unordered_map should be impleme... Closed
related to SERVER-36727 Dump open transactions and currentOp ... Closed
related to SERVER-37406 A stashed Locker should keep informat... Closed
related to SERVER-39245 Log "verbose" session information in ... Closed
is related to SERVER-38706 Hang analyzer complains about undefin... Closed
is related to SERVER-38757 Using abseil hash maps for stdx::unor... Closed
is related to SERVER-42371 Use get_unique_ptr helper in GDB dump... Closed
is related to SERVER-38823 Re-enable dumping of SessionCatalog i... Closed
is related to SERVER-39969 Fix dumping of SessionCatalog in hang... Closed
Backwards Compatibility: Fully Compatible
Sprint: Repl 2018-12-03, Repl 2018-12-17
Participants:

 Description   

Dumping lock manager will show idle transactions that are holding locks. It will be very helpful to also dump the sessions and their transaction participants to show the logical session id and transaction number that is holding the resources. SERVER-37406 will keep that information in the locker. However, dumping the session catalog is able to print more information, like buffered transaction operations and has no performance impact on production system.

One solution is to implement a global function in C++ to dump session catalog. The concern is that it only works on live process and not on core dump. It runs on a live process so that other threads can also run to change the state as mentioned in SERVER-28437. A better but harder solution is to examine the memory using GDB scripting, which avoids all those problems.



 Comments   
Comment by Githook User [ 21/Dec/18 ]

Author:

{'username': 'will62794', 'email': 'william.schultz@mongodb.com', 'name': 'William Schultz'}

Message: SERVER-38045 Remove dump sessions command from hang analyzer
Branch: master
https://github.com/mongodb/mongo/commit/fd29722a1460fe09daefc2ce74b6aa7b49168bc9

Comment by Githook User [ 21/Dec/18 ]

Author:

{'username': 'will62794', 'email': 'william.schultz@mongodb.com', 'name': 'William Schultz'}

Message: SERVER-38045 Disable dumping of the SessionCatalog in the hang analyzer

The recent change to utilize the abseil hash map for stdx::unordered_map breaks the logic used to unpack a LogicalSessionIdMap inside the mongod-dump-sessions GDB command. This commit disabled the command until a suitable workaround is found.
Branch: master
https://github.com/mongodb/mongo/commit/23128892c8d73cb159b881cb00f2404d6ad67b2b

Comment by Githook User [ 20/Dec/18 ]

Author:

{'username': 'will62794', 'email': 'william.schultz@mongodb.com', 'name': 'William Schultz'}

Message: SERVER-38045 Only print fields from the Session if they exist
Branch: master
https://github.com/mongodb/mongo/commit/d504699a4baac29cb2877a9029a32fa0378df9a6

Comment by Githook User [ 19/Dec/18 ]

Author:

{'username': 'will62794', 'email': 'william.schultz@mongodb.com', 'name': 'William Schultz'}

Message: SERVER-38045 Print '_killsRequested' variable instead of '_killRequested' when dumping SessionCatalog in GDB
Branch: master
https://github.com/mongodb/mongo/commit/265493e4c9a7b576cf51a25017148c0bea6d4b93

Comment by Githook User [ 11/Dec/18 ]

Author:

{'name': 'William Schultz', 'email': 'william.schultz@mongodb.com', 'username': 'will62794'}

Message: SERVER-38045 Add GDB tools for dumping the SessionCatalog in the hang analyzer
Branch: master
https://github.com/mongodb/mongo/commit/35da9daad146b3e497ff7c41ab56d563dd0c36e7

Comment by Judah Schvimer [ 14/Nov/18 ]

From max.hirschhorn, this should be implemented as a custom gdb command and then added to the list of gdb commands hang_analyzer.py runs. The implementer should talk to max.hirschhorn, jonathan.abrahams, or mark.benvenuto for how to integrate with the hang analyzer.

Comment by Siyuan Zhou [ 09/Nov/18 ]

william.schultz wrote a GDB script to print out the decorations and we have pretty printer for decorations. They can be a good starting point.

Generated at Thu Feb 08 04:47:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.