pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
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, 21 May 2019 13:45:12 +0900
Message-ID: <20190521044512.GD1921@paquier.xyz> (raw)
In-Reply-To: <7927.1558364465@sss.pgh.pa.us>
References: <20190518093522.GA19212@paquier.xyz>
	<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>

On Mon, May 20, 2019 at 11:01:05AM -0400, Tom Lane wrote:
> In other words, the right way to think about this is less "move
> syslogger launch to earlier" and more "move port opening to later".

> I did some cursory testing of that idea with the attached patch,
> which simply relocates the port opening logic to below where
> syslogger start is (though "git diff" insists on presenting it
> differently :-().  I also moved and recommented the emission
> of the "starting ..." log entry.  It works under EXEC_BACKEND,
> but I'm not fool enough to believe that that proves it works
> under Windows :-(.

I can see what you have done, no worries.

> One issue with this is that we can't be sure we have sole control
> of the postmaster port number at the time we create shmem.

Couldn't that also be a problem for some users?  This means that
there is a window where the port won't be opened but the external PID
file can be found.  Some tools could be broken as an effect of that.

> Hence, to avoid undesirable conflicts of shmem, we should change
> things to base the shmem key on the datadir's ID not the port
> number, as was already speculated about in
> https://postgr.es/m/16908.1557521200@sss.pgh.pa.us

This would be actually nice to change as you suggest.

> Another point is that we want to be sure this doesn't change
> the order in which lockfiles are released at shutdown.  That
> seems OK (I confirmed by strace'ing that the postmaster's
> final syscalls are still done in the same order) but it could
> use some additional eyeballs on it.
> 
> There may be some other reorderings that would be a good idea.
> In particular I'm thinking that the CreateOptsFile call should
> be pushed down, so that it doesn't get written until we know
> that the port number is OK.

Is this thread a good place to discuss all those changes by the way?
After all the recent activity in this area, a new thread and a
discussion for v13 would be I think appropriate.  I would rather not
play with the devil for v12.
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../20190521044512.GD1921@paquier.xyz/2-signature.asc)
  download

view thread (40+ messages)  latest in thread

Message-ID: <20190521044512.GD1921@paquier.xyz>
Permalink:  ../20190521044512.GD1921@paquier.xyz/
Also on:    postgresql.org/message-id/20190521044512.GD1921@paquier.xyz

 · 

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: michael@paquier.xyz, tgl@sss.pgh.pa.us, 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: <20190521044512.GD1921@paquier.xyz>

* 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