Re: Better detection of staled postmaster.pid - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Better detection of staled postmaster.pid
Date
Msg-id 1049479543.2276593.1441030842969.JavaMail.yahoo@mail.yahoo.com
Whole thread Raw
In response to Better detection of staled postmaster.pid  (Pavel Raiskup <praiskup@redhat.com>)
Responses Re: Better detection of staled postmaster.pid  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: Better detection of staled postmaster.pid  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Pavel Raiskup <praiskup@redhat.com> wrote:

> It's been reported [1] that postmaster fails to start against staled
> postmaster.pid after (e.g.) power outage on Fedora, its due to init system
> parallelism and "some" other newly started process can already have allocated
> the same PID as the old postmaster had -- and in this case postmaster refuses
> to delete staled pidfile (which is expected as we need to be really
> careful).
>
> Don't you see some other possible check we could implement to guarantee that
> the PID mentioned in postmaster.pid does not hide concurrent postmaster?
Was the other newly started process another PostgreSQL cluster?
Was it launched under the same OS user?  (Those are the only
conditions under which I've seen this.)  I think it is wise to use
a separate OS user for each cluster.

If it's not a matter of multiple clusters running under the same OS
user, please provide more deails, like the specific version and
copy/paste of error messages and relevant log entries.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Pavel Raiskup
Date:
Subject: Better detection of staled postmaster.pid
Next
From: Tom Lane
Date:
Subject: Re: Buildfarm failure from overly noisy warning message