Re: Fix pg_log_backend_memory_contexts() 's delay - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Fix pg_log_backend_memory_contexts() 's delay
Date
Msg-id CALj2ACVpGVeZw6OO8yeROcn9347kbEppph5Pc1WzJJx3EjXNyg@mail.gmail.com
Whole thread Raw
In response to Fix pg_log_backend_memory_contexts() 's delay  (bt21tanigaway <bt21tanigaway@oss.nttdata.com>)
Responses Re: Fix pg_log_backend_memory_contexts() 's delay  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Oct 5, 2021 at 2:50 PM bt21tanigaway
<bt21tanigaway@oss.nttdata.com> wrote:
>
> Hi,
>
> Log output takes time between several seconds to a few tens when using
> ‘SELECT pg_log_backend_memory_contexts(1234)’ with PID of ‘autovacuum
> launcher’.
> I made a patch for this problem.

Thanks for the patch. Do we also need to do the change in
HandleMainLoopInterrupts, HandleCheckpointerInterrupts,
HandlePgArchInterrupts, HandleWalWriterInterrupts as we don't call
CHECK_FOR_INTERRUPTS() there? And there are also other processes:
pgstat process/statistics collector, syslogger, walreceiver,
walsender, background workers, parallel workers and so on. I think we
need to change in all the processes where we don't call
CHECK_FOR_INTERRUPTS() in their main loops.

Before doing that, we need to be sure of whether we allow only the
user sessions/backend process's memory contexts with
pg_log_backend_memory_contexts or any process that is forked by
postmaster i.e. auxiliary process? The function
pg_log_backend_memory_contexts supports the processes that return a
pgproc structure from this function BackendPidGetProc, it doesn't
attempt to get pgproc structure from AuxiliaryPidGetProc.

Regards,
Bharath Rupireddy.



pgsql-hackers by date:

Previous
From: Dagfinn Ilmari Mannsåker
Date:
Subject: Re: plperl: update ppport.h and fix configure version check
Next
From: Simon Riggs
Date:
Subject: Re: Next Steps with Hash Indexes