Re: enhance pg_log_backend_memory_contexts() to log memory contexts of auxiliary processes

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: enhance pg_log_backend_memory_contexts() to log memory contexts of auxiliary processes
Date: 2021-11-15 16:33:59
Message-ID: CALDaNm3rH6-y+XXm259DrDCBShwz5SJ_wid3P+8+f-diL_d7jQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 15, 2021 at 7:47 AM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> On Fri, Nov 5, 2021 at 11:12 AM Bharath Rupireddy
> <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> > PSA v2 patch and review it.
>
> I've modified the docs part a bit, please consider v3 for review.

Thanks for the update patch, Few comments:
1) Should we change "CHECK_FOR_INTERRUPTS()" to
"CHECK_FOR_INTERRUPTS() or process specific interrupt handlers"
/*
* pg_log_backend_memory_contexts
* Signal a backend process to log its memory contexts.
*
* By default, only superusers are allowed to signal to log the memory
* contexts because allowing any users to issue this request at an unbounded
* rate would cause lots of log messages and which can lead to denial of
* service. Additional roles can be permitted with GRANT.
*
* On receipt of this signal, a backend sets the flag in the signal
* handler, which causes the next CHECK_FOR_INTERRUPTS() to log the
* memory contexts.
*/
Datum
pg_log_backend_memory_contexts(PG_FUNCTION_ARGS)

2) Should we mention Postmaster process also along with logger and
statistics collector process
+ <glossterm linkend="glossary-backend">backend</glossterm> or the
+ <glossterm linkend="glossary-wal-sender">WAL sender</glossterm> or the
+ <glossterm linkend="glossary-auxiliary-proc">auxiliary
process</glossterm>
+ with the specified process ID. All of the
+ <glossterm linkend="glossary-auxiliary-proc">auxiliary
processes</glossterm>
+ are supported except the <glossterm
linkend="glossary-logger">logger</glossterm>
+ and the <glossterm
linkend="glossary-stats-collector">statistics collector</glossterm>
+ as they are not connected to shared memory the function can
not make requests.
+ The backtrace will be logged at <literal>LOG</literal> message level.
+ They 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

Regards,
Vignesh

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-11-15 16:57:36 Re: enhance pg_log_backend_memory_contexts() to log memory contexts of auxiliary processes
Previous Message Dmitry Dolgov 2021-11-15 16:26:41 Re: refactoring basebackup.c