Printing backtrace of postgres processes
vignesh C <vignesh21@gmail.com>
From: vignesh C <vignesh21@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-11-22T03:06:25Z
Lists: pgsql-hackers
Attachments
- 0001-Print-backtrace-of-postgres-process.patch (text/x-patch) patch 0001
Hi, I would like to propose getting the callstack of the postgres process by connecting to the server. This helps us in diagnosing the problems from a customer environment in case of hung process or in case of long running process. The idea here is to implement & expose pg_print_callstack function, internally what this function does is, the connected backend will send SIGUSR1 signal by setting PMSIGNAL_BACKTRACE_EMIT to the postmaster process. Postmaster process will send a SIGUSR1 signal to the process by setting PROCSIG_BACKTRACE_PRINT if the process has access to ProcSignal. As syslogger process & Stats process don't have access to ProcSignal, multiplexing with SIGUSR1 is not possible for these processes, hence SIGUSR2 signal will be sent for these processes. Once the process receives this signal it will log the backtrace of the process. Attached is a WIP patch for the same. Thoughts? Regards, Vignesh EnterpriseDB: http://www.enterprisedb.com
Commits
-
Perform apply of large transactions by parallel workers.
- 216a784829c2 16.0 cited
-
Enhance pg_log_backend_memory_contexts() for auxiliary processes.
- 790fbda90209 15.0 cited
-
Allow GRANT on pg_log_backend_memory_contexts().
- f0b051e322d5 15.0 cited
-
Move Perl test modules to a better namespace
- b3b4d8e68ae8 15.0 cited
-
Unify PostgresNode's new() and get_new_node() methods
- 201a76183e20 15.0 cited
-
Add backtrace support for error reporting
- 71a8a4f6e365 13.0 cited