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

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: smart shutdown at end of transaction (was: Default mode for shutdown)
Date: 2012-04-29 16:04:01
Message-ID: CA+U5nMJ0r01KJPNgNWg5VG7ft5=B4DrNbnFGGctcRTkhvchbyA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Apr 29, 2012 at 4:06 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>> In any case, if either the existing session of the TM is cut or it
>> cannot create a new connection, it will, after some time, have to give
>> up roll back the prepared transactions on the other servers.  So some
>> kind of setting to not shut down if there are prepared transactions
>> pending could be useful.  But this could probably be a separate GUC
>> setting or two instead of a shutdown mode (or two) of its own.
>
> This argument still seems pretty bogus.  The *entire* point of a TM
> is to cope with crashes of individual databases under its management.
> The proposed setting seems to amount to a "please don't crash" GUC,
> which is silly on its face, and does not actually make the TM's life
> any easier anyway.

You are right that the TM can cope with aborted transactions, but that
doesn't mean we should force it to have to do that. If we can wait for
commit then we should do so.

I think we only need one new mode, "shutdown when transactions are
finished" should only shutdown when all types of transaction are
complete. For people that don't use prepared transactions the
difference is irrelevant. For people that do use prepared
transactions, I can't imagine they would want a new setting that ends
with aborted transactions, since that isn't any different to a fast
shutdown.

If that hangs waiting for TM that has gone away, then you can issue
shutdown fast.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2012-04-29 16:19:32 Re: 9.2 release notes, beta time?
Previous Message Tom Lane 2012-04-29 15:08:41 Re: smart shutdown at end of transaction (was: Default mode for shutdown)