On 09/29/2015 11:48 AM, Tom Lane wrote:
> But today I thought of another way: suppose that we teach the postmaster
> to commit hara-kiri if the $PGDATA directory goes away. Since the
> buildfarm script definitely does remove all the temporary data directories
> it creates, this ought to get the job done.
This would also be useful for production. I can't count the number of
times I've accidentally blown away a replica's PGDATA without shutting
the postmaster down first, and then had to do a bunch of kill -9.
In general, having the postmaster survive deletion of PGDATA is
suboptimal. In rare cases of having it survive installation of a new
PGDATA (via PITR restore, for example), I've even seen the zombie
postmaster corrupt the data files.
So if you want this change to be useful beyond the buildfarm, it should
check every few minutes, and you'd SIGQUIT.
--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com