Re: Cancelling idle in transaction state

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Joachim Wieland <joe(at)mcknight(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hannu Krosing <hannu(at)2ndquadrant(dot)com>, James Pye <lists(at)jwp(dot)name>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Cancelling idle in transaction state
Date: 2010-01-01 18:15:14
Message-ID: 4AA21D0D-420B-413E-8EFB-F902029D70E2@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Jan 1, 2010, at 9:42 AM, Simon Riggs <simon(at)2ndQuadrant(dot)com> wrote:
> On Fri, 2010-01-01 at 09:24 -0800, Robert Haas wrote:
>
>>>> If we have other events that can asynchronously roll back a
>>>> transaction, I would think they would deserve similar handling.
>>>> Off
>>>> the top of my head, I'm not sure if there are any such cases.
>>>
>>> Serialization failures, deadlocks, timeouts, SIGINT, out of memory
>>> errors etc..
>>
>> Hmm. I don't think I can get a serialization failure, deadlock, or
>> out
>> of memory error while my session is idle.
>
> Agreed. As a point of note, now that we can cancel idle transactions
> there isn't any future blocker from making serialization failures or
> deadlocks cancel such transactions... Other RDBMS have deadlock
> detectors that can pick any session to resolve, not just the one doing
> the deadlock checking.

Interesting. It's not obvious to me how killing an *idle* session can
resolve a deadlock. AIUI a deadlock requires a cycle in the waits-for
graph, and an idle transaction is not waiting for a lock acquisition.
I can see how it could be useful in handling serialization failures,
though, and there may be other applications as well. This is a nice
improvement; I'm pleased to see it going in.

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Albe Laurenz 2010-01-01 18:16:19 Re: Serializable Isolation without blocking
Previous Message Tom Lane 2010-01-01 17:59:57 Re: Win64 warnings about size_t