Re: How to shoot yourself in the foot: kill -9 postmaster

Поиск
Список
Период
Сортировка
От Alfred Perlstein
Тема Re: How to shoot yourself in the foot: kill -9 postmaster
Дата
Msg-id 20010305154750.D8663@fw.wintelcom.net
обсуждение исходный текст
Ответ на How to shoot yourself in the foot: kill -9 postmaster  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Thomas Swan
Дата:
Сообщение: Re: How to shoot yourself in the foot: kill -9 postmaster
Следующее
От: Tom Lane
Дата:
Сообщение: pg_dump scripts are no longer ordinary-user friendly