Re: smart shutdown at end of transaction (was: Default mode for shutdown)

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: smart shutdown at end of transaction (was: Default mode for shutdown)
Дата
Msg-id 201204272230.10692.andres@anarazel.de
обсуждение исходный текст
Ответ на Re: smart shutdown at end of transaction (was: Default mode for shutdown)  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: smart shutdown at end of transaction (was: Default mode for shutdown)  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On Friday, April 27, 2012 10:17:59 PM Peter Eisentraut wrote:
> On fre, 2012-04-27 at 20:39 +0200, Andres Freund wrote:
> > I think the current smart mode is rather useful. There is quite some
> > stuff that you cannot do inside a transaction - or it doesn't make
> > sense - which still needs to shutdown gracefully. E.g. transaction
> > managers.
> Could you elaborate on that?  What would happen to the transaction
> manager if you terminate any idle, not-in-a-transaction database backend
> sessions it has established?
In the few cases where I investigated it TMs don't use transactions themselves 
(which I think is correct, they don't need them), so terminating any idle 
session - which the TM would appear as, as its not using txns - would leave 
prepared transactions in a limbo state till the database is up again, instead 
of waiting till all prepared transactions are either aborted or committed. It 
may also choose to coordinate to abort all transactions, but all that is hard 
if the database shuts you out.
I actually also have co-maintained other software where some processes have an 
idle connection open on which some shutdown stuff will happen. Obviously all 
those will need to handle the case where the connection was aborted, but that 
may result in suboptimal behaviour. Requiring such processes to keep open a 
transaction doesn't seem to be a good design choice in the pg world.

Andres


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: plpython crash (PG 92)
Следующее
От: Aakash Goel
Дата:
Сообщение: Re: xReader, double-effort (was: Temporary tables under hot standby)