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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to shoot yourself in the foot: kill -9 postmaster
Дата
Msg-id 3632.983845700@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How to shoot yourself in the foot: kill -9 postmaster  (Hiroshi Inoue <Inoue@tpf.co.jp>)
Список pgsql-hackers
Hiroshi Inoue <Inoue@tpf.co.jp> writes:
> Tom Lane wrote:
>> I think we need a stronger interlock to prevent this scenario, but I'm
>> unsure what it should be.  Ideas?

> Seems the simplest way is to inhibit starting postmaster
> if the pid file exists.

Then we're unable to recover from a crash without manual intervention.

The tricky part of this is not to give up the ability to restart when
there *has* been a crash.

> Another way is to use flock() if flock() is available.
> We could flock() the pid file so that another postmaster
> could detect the lock of the file.

This would only work if every backend is holding flock on the file,
which would mean they'd all have to keep it open all the time.  Kind
of annoying to use up that many file descriptors on it.  Might be the
best answer though; I haven't thought of anything I like better...
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Lamar Owen
Дата:
Сообщение: Re: How to shoot yourself in the foot: kill -9 postmaster
Следующее
От: Lamar Owen
Дата:
Сообщение: Re: How to shoot yourself in the foot: kill -9 postmaster