Re: BUG #15804: Assertion failure when using logging_collector with EXEC_BACKEND

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Yuli Khodorkovskiy <yuli(dot)khodorkovskiy(at)crunchydata(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Subject: Re: BUG #15804: Assertion failure when using logging_collector with EXEC_BACKEND
Date: 2019-05-20 01:54:45
Message-ID: 20190520015445.GF1923@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, May 18, 2019 at 01:07:15PM -0400, Tom Lane wrote:
> I've not worked that out in any detail; getting the switches included
> properly might be too much of a pain for this to be an improvement.
> But for sure I don't want there to be multiple copies of that list of
> which subprocess types use shared memory.

Getting rid of the process list dependency would be nice.

> A variant idea is to include shared_memory_exists in what's passed down
> by the BackendParameters mechanism, and then subprocesses can adjust
> their behavior for themselves.

I actually got to think about having extra switches to control the
re-attachment of sub-processes when thinking about a solution, and I
agree that it would be much cleaner. The idea about using backend
parameters is interesting (I haven't considered it), though I feel
that this could introduce race conditions as the process startup
scheduling can cause tricky issues on Windows, so I think that this
would make the system less robust. Using a state specific to the
postmaster for the decision-making ensures a single entry point.

> In any case, the thrust of all of this is that we shouldn't touch any
> of the assertions in the shmem support files; rather, the way to fix
> it is to improve the logic in postmaster.c so that we don't call those
> functions at all in child processes that are launched before shmem
> exists.

I certainly agree with that. Those assertions are here to stay.
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-05-20 04:10:17 Re: BUG #15804: Assertion failure when using logging_collector with EXEC_BACKEND
Previous Message Michael Paquier 2019-05-20 01:27:28 Re: BUG #15804: Assertion failure when using logging_collector with EXEC_BACKEND