Re: postmaster.pid file auto-clean up?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sebastien Boisvert <sebastienboisvert(at)yahoo(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: postmaster.pid file auto-clean up?
Date: 2012-08-21 03:30:56
Message-ID: 17313.1345519856@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sebastien Boisvert <sebastienboisvert(at)yahoo(dot)com> writes:
> Is this mechanism documented anywhere (besides source code)?

No, not really.

> It looks like PG will only clean it up if there's no other process running at all on the pid listed in the postmaster.pid file, even if any process running on that pid isn't a PG process or there's no server running on the data directory (as per `pg_ctl status`).

Not sure what you're looking at, but the above is wrong in at least one
critical detail, namely that there's a process-ownership check via
kill(). There are also checks to ensure no children of the previous
postmaster are still alive. These are not things you want to lightly
bypass: two sets of postmaster children running against the same data
directory *will* result in unrecoverable data corruption.

If you're trying to claim you've seen a false-positive situation, it
would be interesting to hear actual details.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sébastien Lorion 2012-08-21 05:33:31 Amazon High I/O instances
Previous Message Sebastien Boisvert 2012-08-21 03:03:20 Re: postmaster.pid file auto-clean up?