Re: Printing backtrace of postgres processes

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Craig Ringer <craig(dot)ringer(at)enterprisedb(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Printing backtrace of postgres processes
Date: 2021-11-14 15:16:00
Message-ID: CALDaNm3BYGOG3-PQvYbWkB=G3h1KYJ8CO8UYbzfECH4DYGMGqA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 12, 2021 at 5:15 PM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> On Thu, Nov 11, 2021 at 12:14 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> > Thanks for the comments, the attached v10 patch has the fixes for the same.
>
> Thanks for the patches. Here are some comments:
>
> 1) In the docs, let's have the similar description of
> pg_log_backend_memory_contexts for pg_print_backtrace, just for the
> continuity in the users readability.

I have kept some contents of the description similar. There is some
additional information to explain more about the functionality. I felt
that will help the user to understand more about the feature.

> 2) I don't know how the <screen> part looks like in the Server
> Signaling Functions table. I think here you can just say, it will emit
> a warning and return false if not supported by the installation. And
> you can give the <screen> part after the description where you are
> showing a sample backtrace.
>
> + capture backtrace. If not available, the function will return false
> + and a warning is issued, for example:
> +<screen>
> +WARNING: backtrace generation is not supported by this installation
> + pg_print_backtrace
> +--------------------
> + f
> +</screen>
> + </para></entry>
> + </row>

Modified

> 3) Replace '!' with '.'.
> + * Note: this is called within a signal handler! All we can do is set

I have changed it similar to HandleLogMemoryContextInterrupt

> 4) It is not only the next CFI but also the process specific interrupt
> handlers (in your 0002 patch) right?
> + * a flag that will cause the next CHECK_FOR_INTERRUPTS to invoke

Modified

> 5) I think you need to update CATALOG_VERSION_NO, mostly the committer
> will take care of it but just in case.

Modified

> 6) Be consistent with casing "Verify" and "Might"
> +# Verify that log output gets to the file
> +# might need to retry if logging collector process is slow...

Modified

The attached v11 patch has the changes for the same.

Regards,
Vignesh

Attachment Content-Type Size
v11-0001-Print-backtrace-of-specified-postgres-process.patch text/x-patch 21.9 KB
v11-0002-pg_print_backtrace-support-for-printing-backtrac.patch text/x-patch 10.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2021-11-14 15:18:52 Re: Printing backtrace of postgres processes
Previous Message Bharath Rupireddy 2021-11-14 12:18:18 Re: Logical Replication - improve error message while adding tables to the publication in check_publication_add_relation