From: | "Euler Taveira" <euler(at)eulerto(dot)com> |
---|---|
To: | "Fujii Masao" <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, "Alvaro Herrera" <alvherre(at)alvh(dot)no-ip(dot)org> |
Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: log_min_messages per backend type |
Date: | 2025-03-06 14:33:58 |
Message-ID: | 85909114-36a8-4d92-b959-4d9788fd3f5a@app.fastmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Mar 5, 2025, at 11:53 PM, Fujii Masao wrote:
> On 2025/03/05 9:33, Euler Taveira wrote:
> >> > + Valid <literal>BACKENDTYPE</literal> values are <literal>ARCHIVER</literal>,
> >> > + <literal>AUTOVACUUM</literal>, <literal>BACKEND</literal>,
> >> > + <literal>BGWORKER</literal>, <literal>BGWRITER</literal>,
> >> > + <literal>CHECKPOINTER</literal>, <literal>LOGGER</literal>,
> >> > + <literal>SLOTSYNCWORKER</literal>, <literal>WALRECEIVER</literal>,
> >> > + <literal>WALSENDER</literal>, <literal>WALSUMMARIZER</literal>, and
> >> > + <literal>WALWRITER</literal>.
>
> What about postmaster?
It is B_INVALID that is currently mapped to "backend". This state is used as an
initial phase for the child process. There might be messages before
MyBackendType is assigned (see ProcessStartupPacket, for example). Hence, I
refrain to create a special backend type for postmaster. Should we map it to
generic log level instead of backend?
> For parallel workers launched for parallel queries, should they follow
> the backend's log level or the background worker's? Since they operate
> as part of a parallel query executed by a backend, it seems more logical
> for them to follow the backend's setting.
Since we are using enum BackendType and there is no special entry for parallel
query processes. I'm afraid that introducing conditional logic for checking
special cases like the bgw_type for parallel queries or MyProcPid ==
PostmasterPid might slowdown that code path. (See that should_output_to_server
is an inline function.) I will run some tests to see if there is a considerable
impact.
> + [B_CHECKPOINTER] = "checkpointer",
> + [B_STARTUP] = "backend", /* XXX same as backend? */
>
> I like the idea of allowing log levels to be set per process.
> There were times I wanted to use debug5 specifically for
> the startup process when troubleshooting WAL replay. It would be
> helpful to distinguish the startup process from a regular backend,
> so we can set its log level independently.
Although startup process is mapped to backend (hence, the XXX), we can
certainly create a separate backend type for it.
--
Euler Taveira
EDB https://www.enterprisedb.com/
From | Date | Subject | |
---|---|---|---|
Next Message | Bykov Ivan | 2025-03-06 14:39:48 | RE: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET |
Previous Message | Bykov Ivan | 2025-03-06 14:32:41 | RE: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET |