Re: HS/SR and smart shutdown

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: HS/SR and smart shutdown
Дата
Msg-id 4B5801FE.1010908@enterprisedb.com
обсуждение исходный текст
Ответ на Re: HS/SR and smart shutdown  (Fujii Masao <masao.fujii@gmail.com>)
Ответы Re: HS/SR and smart shutdown  (Greg Smith <greg@2ndquadrant.com>)
Re: HS/SR and smart shutdown  (Fujii Masao <masao.fujii@gmail.com>)
Re: HS/SR and smart shutdown  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
Fujii Masao wrote:
> On Thu, Jan 21, 2010 at 10:44 AM, Josh Berkus <josh@agliodbs.com> wrote:
>>> If it's "standby", it's a previously-existing behavior that a "smart"
>>> shutdown doesn't work immediately during recovery. After a recovery
>>> has been completed, it would work. Of course, I agree that such a
>>> behavior should be documented.
>> Well, as long as streaming rep is running, you can't do a smart shutdown
>> ... smart shutdown seems to treat the walreciever as a client
>> connection.
> 
> Even if SR is not running, as long as the startup process is running,
> we can't do a smart shutdown. It's not peculiar to SR.

Right, that's the way a standby server (= one still in recovery) has
always behaved. It has made sense in the past: it's not in the spirit of
smart shutdown to kill the WAL replay immediately. "smart" means wait
for recovery to finish, then shutdown.

It's a good question if that still makes sense with Hot Standby. Perhaps
we should redefine smart shutdown in standby mode to shut down as soon
as all read-only connections have died.

>>  At the very least, this should be in the documentation.
> 
> Agreed. Something like "smart shutdown is not allowed during recovery"
> should be in the following section.
> http://developer.postgresql.org/pgdocs/postgres/server-shutdown.html

It's allowed, it just doesn't do what you might expect.


In the master, smart shutdown shuts down as soon as all regular backends
are gone. It doesn't wait for the standby connections to die. In fact
they're not killed until after the shutdown checkpoint is written, so
that it gets sent to the standbys too. I think we're good there.

--  Heikki Linnakangas EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: Alex Hunsaker
Дата:
Сообщение: Re: attoptions
Следующее
От: Pavel Stehule
Дата:
Сообщение: is any reason why we cannot cast from record (row) to typed row?