Skip site navigation (1) Skip section navigation (2)

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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: smart shutdown at end of transaction (was: Default mode for shutdown)
Date: 2012-04-27 17:49:39
Message-ID: CA+TgmoaXHnAZEGAw03tC78Y4ByRLha_Xzw3OS+FCdsT8bDNE7w@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Fri, Apr 27, 2012 at 1:46 PM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> On Fri, Apr 27, 2012 at 19:42, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> On Wed, Dec 15, 2010 at 10:11 AM, Alvaro Herrera
>> <alvherre(at)commandprompt(dot)com> wrote:
>>> It occurs to me that we may need a new mode, which disconnects sessions
>>> that are not in a transaction (or as soon as they are) but leaves
>>> in-progress transactions alone; this could be the new default.  Of
>>> course, this is much more difficult to implement than the current modes.
>>
>> This idea appeared to have some support.  I'd like to suggest that we
>> take this a step further.  Instead of adding a fourth mode, I'd like
>> to suggest that we redefine "smart" to have the behavior described
>
> +1762329!

Thanks.  :-)

>> above.  This is based on the theory that (1) people who like smart
>> shutdown like it because it allows currently-running transactions to
>> complete without error, and will find it acceptable to have idle
>> transactions terminated immediately and other sessions terminated
>
> Uh, I don't think it's ok to terminate an idle transaction
> immediately. An idle *session* is ok, though - maybe that's what you
> mean?

Yes, exactly.  What the patch does is arrange things so that, when
smart shutdown is requested, we terminate each session as soon as it
is both (1) idle and (2) not in a transaction.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

pgsql-hackers by date

Next:From: Josh BerkusDate: 2012-04-27 17:59:49
Subject: Re: Future In-Core Replication
Previous:From: Magnus HaganderDate: 2012-04-27 17:46:13
Subject: Re: smart shutdown at end of transaction (was: Default mode for shutdown)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group