Re: Attempt to stop dead instance can stop a random process?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Attempt to stop dead instance can stop a random process?
Date: 2007-08-31 19:18:03
Message-ID: 381.1188587883@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-08-31 19:20:20 Re: Password requirement in windows installer
Previous Message Decibel! 2007-08-31 19:12:03 Re: Password requirement in windows installer