Re: BUG #15804: Assertion failure when using logging_collector with EXEC_BACKEND
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Yuli Khodorkovskiy <yuli.khodorkovskiy@crunchydata.com>, pgsql-bugs@lists.postgresql.org, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Date: 2019-05-15T07:31:25Z
Lists: pgsql-bugs
Attachments
- shmem-noattach.patch (text/x-diff) patch
On Tue, May 14, 2019 at 03:52:04PM -0400, Tom Lane wrote: > It might be better to give up the assertion in PGSharedMemoryNoReAttach, > and just make it work more like PGSharedMemoryDetach, ie "detach if > UsedShmemSegAddr is set, else do nothing". I don't remember for sure, > but if we do that, there might be no functional difference anymore > between those two functions, in which case we might as well merge 'em. It would be nice to fix that before beta1 is out, or we are going to get complaints :( So what about dropping PGSharedMemoryNoReAttach() completely and using (or abusing of?) the detach routine so as we rely on its no-op behavior when a subprocess is not attached yet to a shared memory segment. On Windows, the sub-processes calling NoReAttach don't map to a segment per the comments in the code, and I can indeed see some "could not map" LOG messages coming from these in the logs if enforcing the use of the detach routine in postmaster.c. It could actually be an advantage to unmap using UnmapViewOfFile() so as a subsequent call of ReAttach does not finish by mapping an extra time. We may consider lowering the LOG messages to DEBUG1, or extend the detach routine so as we control the level of logs with an elevel to avoid sparse LOG messages when unmapping from shared segments where we know it would fail. I have been playing with the attached using EXEC_BACKEND on Linux and some Windows builds FWIW. Thoughts? -- Michael
Commits
-
Rearrange postmaster's startup sequence for better syslogger results.
- 9a86f03b4e8c 13.0 landed
-
Improve logrotate test so that it meaningfully exercises syslogger.
- 9d5c22d28f8c 12.0 landed
-
Revert "postmaster: Start syslogger earlier".
- 833451552925 12.0 landed
-
postmaster: Start syslogger earlier
- 57431a911d3a 12.0 cited