Re: Attempt to stop dead instance can stop a random process? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Attempt to stop dead instance can stop a random process?
Date
Msg-id 381.1188587883@sss.pgh.pa.us
Whole thread Raw
In response to Attempt to stop dead instance can stop a random process?  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: Attempt to stop dead instance can stop a random process?  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-hackers
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> It appears that when pg_ctl gets a stop request for a given directory, it l=
> ooks for a pid file in that directory and signals that pid to stop.  It doe=
> sn't appear to check that the pid is for a PostgreSQL postmaster running ou=
> t of the given directory.  I think it should, although on a quick scan of t=
> he code, I didn't see a convenient way to do that.

[ shrug... ]  AFAICS there is no way to know that.

> I have some evidence that when we attempted to stop a PostgreSQL instance w=
> hich (it turned out) had died without cleaning up the pid file, it actually=
>  stopped another instance which was using a different data directory but ha=
> d wrapped around to the same pid.

The real question there is how come the postmaster died without removing
the pidfile.  It's not that easy to crash the postmaster ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Decibel!
Date:
Subject: Re: Password requirement in windows installer
Next
From: Gregory Stark
Date:
Subject: Re: Password requirement in windows installer