Re: How to shoot yourself in the foot: kill -9 postmaster - Mailing list pgsql-hackers

From Alfred Perlstein
Subject Re: How to shoot yourself in the foot: kill -9 postmaster
Date
Msg-id 20010305154750.D8663@fw.wintelcom.net
Whole thread Raw
In response to How to shoot yourself in the foot: kill -9 postmaster  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
* Tom Lane <tgl@sss.pgh.pa.us> [010305 14:51] wrote:
> 
> I think we need a stronger interlock to prevent this scenario, but I'm
> unsure what it should be.  Ideas?

Re having multiple postmasters active by accident.

The sysV IPC stuff has some hooks in it that may help you.

One idea is to check the 'struct shmid_ds' feild 'shm_nattch',
basically at startup if it's not 1 (or 0) then you have more than
one postgresql instance messing with it and it should not proceed.

I'd also suggest looking into using sysV semaphores and the semundo
stuff, afaik it can be used to track the number of consumers of
a reasource.

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]


pgsql-hackers by date:

Previous
From: Thomas Swan
Date:
Subject: Re: How to shoot yourself in the foot: kill -9 postmaster
Next
From: Tom Lane
Date:
Subject: pg_dump scripts are no longer ordinary-user friendly