Re: Printing backtrace of postgres processes

Justin Pryzby <pryzby@telsasoft.com>

From: Justin Pryzby <pryzby@telsasoft.com>
To: vignesh C <vignesh21@gmail.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Andres Freund <andres@anarazel.de>, Craig Ringer <craig.ringer@enterprisedb.com>, Robert Haas <robertmhaas@gmail.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, pgsql-hackers@lists.postgresql.org
Date: 2021-05-06T02:13:24Z
Lists: pgsql-hackers
Here's a cleaned-up copy of the doc text.

Send a request to the backend with the specified process ID to log its backtrace.
The backtrace will be logged at message level <literal>LOG</literal>.
It will appear in the server log based on the log configuration set
(See <xref linkend="runtime-config-logging"/> for more information),
but will not be sent to the client regardless of
<xref linkend="guc-client-min-messages"/>.
A backtrace will identify where exactly the backend process is currently
executing. This may be useful to developers to diagnose stuck
processes and other problems. This feature is
not supported for the postmaster, logger, or statistics collector process. This
feature will be available if PostgreSQL was built
with the ability to capture backtracee.  If not available, the function will
return false and show a WARNING.
Only superusers can request backends to log their backtrace.

> - * this and related functions are not inlined.
> + * this and related functions are not inlined. If edata pointer is valid
> + * backtrace information will set in edata.

will *be* set

-- 
Justin



Commits

  1. Perform apply of large transactions by parallel workers.

  2. Enhance pg_log_backend_memory_contexts() for auxiliary processes.

  3. Allow GRANT on pg_log_backend_memory_contexts().

  4. Move Perl test modules to a better namespace

  5. Unify PostgresNode's new() and get_new_node() methods

  6. Add backtrace support for error reporting