Re: Something is fairly whacko about shutdown in CVS HEAD

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Something is fairly whacko about shutdown in CVS HEAD
Дата
Msg-id 11757.1183298802@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Something is fairly whacko about shutdown in CVS HEAD  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane wrote:
>> To resolve this I think we need a clearer definition of the autovac
>> launcher's role in life.  I see that it is attached to shared memory;
>> is it supposed to be able to execute transactions or otherwise do
>> anything the bgwriter might have to clean up after?

> No; the launcher is attached to shared memory, but it doesn't connect to
> databases and it doesn't execute transactions either.  In fact, the
> launcher cannot do anything when the postmaster is not running (or when
> it is not in a state where it doesn't want to start processes, anyway),
> because it (the launcher) is only capable of sending signals to
> postmaster (apart from that, it ocasionally grabs lwlocks, reads the
> pg_database flat file, pgstats, and the Xid counter in shared memory).
> It doesn't write anything.  I think it is perfectly acceptable to have
> the launcher shut down in parallel with bgwriter.

[ after sleeping on it... ]  That's probably okay as far as bgwriter
goes, but I think it's a bad idea for anything connected to shared
memory to outlive the postmaster.  To do so opens risks that some
platforms might treat the postmaster's shmctl(IPC_RMID) differently
than others.  So I want the postmaster to not exit until it's seen
the launcher quit.  It's quite easy to make this happen if we treat
the launcher more like a backend, and don't start bgwriter shutdown
till it's gone.  (I have a patch I've been testing that does it that
way.)  Allowing the two to shut down in parallel seems more complex,
though if you see a reasonable way to make it work, propose a patch.
        regards, tom lane


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

Предыдущее
От: KaiGai Kohei
Дата:
Сообщение: [ANN] SE-PostgreSQL 1.0 Beta released
Следующее
От: Tom Lane
Дата:
Сообщение: Restartable signals 'n all that