Re: Archiver behavior at shutdown

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Archiver behavior at shutdown
Дата
Msg-id 20071227222420.GA5659@alvh.no-ip.org
обсуждение исходный текст
Ответ на Archiver behavior at shutdown  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Archiver behavior at shutdown  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:

> ISTM the postmaster should leave the archiver alone at the
> PM_WAIT_BACKENDS -> PM_SHUTDOWN transition, and instead send it
> a WAKEN signal (SIGUSR1) when it sees normal exit of the bgwriter.
> That will afford an opportunity to archive anything that was pushed
> out during the shutdown checkpoint.

What does postmaster do then?  Sleep until archiver is done, or exit
immediately and hope that the archiver goes away as soon as it finishes?
If the former, then we open the possibility that postmaster lives far
too long before system shutdown decides to SIGKILL it.  If the latter,
then a subsequent postmaster start could initiate a second archiver
process which would cause issues with whatever the first archiver is
doing.

I think your proposal to handle SIGTERM could also be used whenever
postmaster has been asked for shutdown (except smart shutdown,
perhaps?):

> I suggest that the response to SIGTERM ought to be to finish
> out the current copy operation (if possible) but then quit without
> initiating any new ones.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Spoofing as the postmaster
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Archiver behavior at shutdown