On Mon, May 25, 2026, at 5:21 AM, Michael Paquier wrote:
> On Mon, May 25, 2026 at 04:45:41PM +0900, Michael Paquier wrote:
>> I did not take the cycles necessary for a bisect, but it looks like
>> this has been around for a few months at least. I have pinged
>> f3c9e341cdf1 as a safe startup point for now, so that's a 2026 issue.
>
> Well, well:
> 0c8e082fba8d36434552d3d7800abda54acafd57 is the first bad commit
> committer: Álvaro Herrera <[email protected]>
> date: Wed, 4 Feb 2026 16:56:57 +0100
> Assign "backend" type earlier during process start-up
>
> I have also checked manually a revert of this commit, and saw that the
> problem is gone, so it does not look like I have messed up my bisect.
>
It seems I was too optimistic about this patch. Since the commit 0c8e082fba8
sets MyBackendType to B_LOGGER earlier, it breaks the following assumption in
syslogger.c.
/*
* If we're told to write to a structured log file, but it's not open,
* dump the data to syslogFile (which is always open) instead. This can
* happen if structured output is enabled after postmaster start and
we've
* been unable to open logFile. There are also race conditions during a
* parameter change whereby backends might send us structured output
* before we open the logFile or after we close it. Writing formatted
* output to the regular log file isn't great, but it beats dropping log
* output on the floor.
It shouldn't assume syslogFile is always open. The send_message_to_server_log()
shouldn't be executing the following code path in this case.
/* If in the syslogger process, try to write messages direct to file */
if (MyBackendType == B_LOGGER)
write_syslogger_file(buf.data, buf.len, LOG_DESTINATION_STDERR);
It could set MyBackendType only if child_type != B_LOGGER during
launch_backend.c and set it at the same code path as in the past. However, I
consider this solution ugly and hackish.
--
Euler Taveira
EDB https://www.enterprisedb.com/