Bug #104625 Save backtraces when crashing due to semaphore waits
Submitted: 14 Aug 2021 17:27 Modified: 15 Aug 2021 5:11
Reporter: Marcos Albe (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version:5.7,8.0 OS:Any
Assigned to: CPU Architecture:Any

[14 Aug 2021 17:27] Marcos Albe
Description:
Saving a dump of the threads state when InnoDB will self-terminate due to too-long semaphore wait, would be tremendously useful.  

Could be in poor-man-profiler format even, and would be a tremendously good complement to the InnoDB monitor outputs (and a great companion of https://bugs.mysql.com/bug.php?id=94608) 

Hope the request makes sense...it's a bit frustrating to troubleshoot semaphores without a bit more insight, and most people simply don't have monitoring that will trigger a pmp capture when semaphore wait times go too high.

Thanks!!

How to repeat:
Hit any bug that triggers a semaphore-wait induced crash, and which involves background threads.  

Try to troubleshoot by looking only at InnoDB Monitor output. 

Fail in doing so due to lack of information about background threads in the error log.

Suggested fix:
- Add pmp output to error log, or simply a pstack output in a separate mysqld.<PID>.pstack  file.  I wouldn't care much about format :)

- Dump P_S.threads (as per https://bugs.mysql.com/bug.php?id=94608)
[15 Aug 2021 5:11] MySQL Verification Team
Hello Marcos,

Thank you for your reasonable feature request.

regards,
Umesh