pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Yuli Khodorkovskiy <yuli.khodorkovskiy@crunchydata.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15804: Assertion failure when using logging_collector with EXEC_BACKEND
Date: Tue, 10 Sep 2019 01:28:51 -0400
Message-ID: <6728.1568093331@sss.pgh.pa.us> (raw)
In-Reply-To: <20190910051115.GB22934@paquier.xyz>
References: <28565.1558196308@sss.pgh.pa.us>
	<20190519004344.GA3653@paquier.xyz>
	<22995.1558278322@sss.pgh.pa.us>
	<27719.1558282181@sss.pgh.pa.us>
	<16df9d01-8b03-2664-a18c-16c40186f5ab@2ndQuadrant.com>
	<2702.1558289980@sss.pgh.pa.us>
	<20190520012728.GC1923@paquier.xyz>
	<1664.1558325417@sss.pgh.pa.us>
	<7927.1558364465@sss.pgh.pa.us>
	<31457.1568057723@sss.pgh.pa.us>
	<20190910051115.GB22934@paquier.xyz>

Michael Paquier <michael@paquier.xyz> writes:
> Do we need to worry about the port being opened after the external PID
> file is written though?  With some imagination it is possible to
> imagine that some folks rely on the external PID file to be present
> before attempting to access Postgres when not using pg_ctl.  Still, I
> would discard that as postmaster.pid gets written before opening the
> port already.

Hm, that's a good point.  Extending my comment upthread, the existing
code sequence is

	* create datadir lock file
	* create sockets
	* create shmem
	* create external PID file, if requested
	* launch syslogger

which this patch proposes to rearrange to

	* create datadir lock file
	* create shmem
	* create external PID file, if requested
	* launch syslogger
	* create sockets

As far as the datadir lock file is concerned, it's there first in any case.
You could imagine some external code that expects that the socket-related
lines in postmaster.pid will be filled before the shmem key line is,
in which case this patch would break it.  But it's hard to see exactly
what such an expectation would consist of.  There isn't really any
good reason for external code to look at the shmem key line at all.

But the external PID file is a different story.  I can believe that
something might be expecting the sockets to be open before we create
that file --- and since we're not using that file for an interlock,
there's no reason to be in a hurry to create it.  I think it'd make
sense to move that step further down, so it's still done after the
create-sockets step.

			regards, tom lane





view thread (40+ messages)  latest in thread

Message-ID: <6728.1568093331@sss.pgh.pa.us>
Permalink:  ../6728.1568093331@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6728.1568093331@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, andrew.dunstan@2ndquadrant.com, andres@anarazel.de, peter.eisentraut@2ndquadrant.com, yuli.khodorkovskiy@crunchydata.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15804: Assertion failure when using logging_collector with EXEC_BACKEND
  In-Reply-To: <6728.1568093331@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox