Re: [GENERAL] Shutting down a warm standby database in 8.2beta3

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] Shutting down a warm standby database in 8.2beta3
Дата
Msg-id 24689.1163824836@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] Shutting down a warm standby database in 8.2beta3  (Stephen Harris <lists@spuddy.org>)
Ответы Re: [GENERAL] Shutting down a warm standby database in 8.2beta3  (Stephen Harris <lists@spuddy.org>)
Список pgsql-hackers
Stephen Harris <lists@spuddy.org> writes:
> On Fri, Nov 17, 2006 at 10:49:39PM -0500, Tom Lane wrote:
>> This does not apply to signals originated by the postmaster --- it
>> doesn't even know that the child process is doing a system(), much less
>> have any way to signal the grandchild.  Ugh.

> Why not, after calling fork() create a new process group with setsid() and
> then instead of killing the recovery thread, kill the whole process group
> (-PID rather than PID)?  Then every process (the recovery thread, the
> system, the script, any child of the script) will all receive the signal.

This seems like a good answer if setsid and/or setpgrp are universally
available.  I fear it won't work on Windows though :-(.  Also, each
backend would become its own process group leader --- does anyone know
if adding hundreds of process groups would slow down any popular
kernels?

[ thinks for a bit... ]  Another issue is that there'd be a race
condition during backend start: if the postmaster tries to kill -PID
before the backend has managed to execute setsid, it wouldn't work.
        regards, tom lane


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

Предыдущее
От: Stephen Harris
Дата:
Сообщение: Re: [GENERAL] Shutting down a warm standby database in 8.2beta3
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCHES] Brazilian FAQ update