Re: pending patch: Re: HS/SR and smart shutdown

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: pending patch: Re: HS/SR and smart shutdown
Дата
Msg-id y2n603c8f071003310629x6b66731fv1a86fcb39d694cd2@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pending patch: Re: HS/SR and smart shutdown  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
On Wed, Mar 31, 2010 at 4:00 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
> Please add some docs that a) explains what the patch does and b) notes
> any changes from behaviour in previous releases. ISTM this is a major
> change in behaviour.

I guess I see this a little bit differently.  If you do a smart
shutdown on 8.4, the autovacuum launcher won't prevent s smart
shutdown from completing successfully.  Neither will the background
writer.  If they did, we'd consider that a bug and fix it.
walreceiver is just one more system process that needs to get properly
shut down when a smart shutdown is requested.  So I don't think this
is a major behavior change - I think it's preserving the behavior
we've had all along.

The current documentation reads:

In stop mode, the server that is running in the specified data
directory is shut down. Three different shutdown methods can be
selected with the -m option: "Smart" mode waits for online backup mode
to finish and all the clients to disconnect. This is the default.
"Fast" mode does not wait for clients to disconnect and will terminate
an online backup in progress. All active transactions are rolled back
and clients are forcibly disconnected, then the server is shut down.
"Immediate"  mode will abort all server processes without a clean
shutdown. This will lead to a recovery run on restart.

That all still seems accurate after this patch.  I'm not even sure
what to add.  I suppose we could add a sentence like

If a smart shutdown is requested while the server is in recovery,
recovery will stop and the server will shut down.

...but if we add that then why don't we have a similar sentence that says:

If a smart shutdown is requested while the autovacuum launcher is
running, the autovacuum launcher will be stopped and the server will
shut down.

I just don't see that we're adding any additional clarity here.  I
think what would require documentation is if we DIDN'T apply this
patch.  Then we'd need something like:

Smart shutdown mode should not be used if streaming replication is in
use.  The server will begin to shut down but, because the streaming
replication process is not automatically shut down, it will never
actually finish shutting down unless the streaming replication process
crashes.  If a server using streaming replication is accidentally shut
down using smart mode, the problem can be corrected by shutting down
again using fast or immediate mode.

...Robert


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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: sorry, too many standbys already vs. MaxWalSenders vs. max_wal_senders
Следующее
От: Robert Haas
Дата:
Сообщение: Re: sorry, too many standbys already vs. MaxWalSenders vs. max_wal_senders