From: Noah Misch <noah@leadboat.com>
To: David Johnston <polobo@yahoo.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Weaker shmem interlock w/o postmaster.pid
Date: Wed, 11 Sep 2013 23:25:20 -0400
Message-ID: <20130912032520.GA261339@tornado.leadboat.com> (raw)
In-Reply-To: <1378954642417-5770559.post@n5.nabble.com>
References: <20130911033341.GD225735@tornado.leadboat.com>
<20130911153200.GD2706@tamriel.snowman.net>
<20130912022800.GB260242@tornado.leadboat.com>
<1378954642417-5770559.post@n5.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On Wed, Sep 11, 2013 at 07:57:22PM -0700, David Johnston wrote:
> Noah Misch-2 wrote
> > Making PGSharedMemoryCreate() pickier in all branches will greatly
> > diminish
> > the marginal value of preserving postmaster.pid, so I'm fine with dropping
> > the
> > postmaster.pid side of the proposal.
>
> Its probably still worth a fresh look at the immediate shutdown process to
> see whether the current location where postmaster.pid is removed is
> acceptable. It may not be necessary to leave it in place always but:
>
> 1) if there is a section of shared memory that can only be reached/found if
> one knows the pid, and
Similar: one needs a sysv shared memory key to find the segment, and
postmaster.pid records that key. The chosen key is almost always the same
from run to run, so a new postmaster typically does find the old segment even
without postmaster.pid.
> 2) postmaster.pid is removed before that area is "secured from future
> clobbering"
Clobbering shared memory is not the actual threat here. We use the shared
memory segment as a witness to the fact that PostgreSQL processes are active
in a data directory. If we let children of different postmasters operate in
the same directory simultaneously, they can corrupt data.
> then there may be a risk that can still be mitigated by moving its removal
> without having to go to the extreme.
--
Noah Misch
EnterpriseDB http://www.enterprisedb.com
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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-hackers@postgresql.org
Cc: noah@leadboat.com, polobo@yahoo.com
Subject: Re: Weaker shmem interlock w/o postmaster.pid
In-Reply-To: <20130912032520.GA261339@tornado.leadboat.com>
* 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