Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: David Steele <david(at)pgmasters(dot)net>, Stephen Frost <sfrost(at)snowman(dot)net>, Joe Conway <mail(at)joeconway(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions
Date: 2015-11-06 05:49:45
Message-ID: CAMsr+YGuj3w5wwo_O9SkYW4Kd16z44ymr1=sKdpJ0FGqHU2wOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5 November 2015 at 23:10, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
> David Steele wrote:
>
>> The important thing about this implementation was that nothing was
>> terminated unless it had exceed a timeout AND was blocking another
>> process.
>
> This seems a nice idea, but you need to take the effect on vacuum of
> idle-in-xact sessions too. If the operator left for the day and their
> session doesn't block any other process, the next day you could find
> some tables bloated to such extreme as to cause problems later on.

The additional qualifier "and isn't pinning xmin" would probably be
useful there. Often it's pretty harmless to keep an xact open for
ages, the problem has, until the recent changes in pg_stat_activity,
been knowing when.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-11-06 05:52:44 Re: Within CF app, "Bug Fixes" should be "Bug Fixes/Refactoring"
Previous Message Craig Ringer 2015-11-06 05:43:33 Re: Patch: Implement failover on libpq connect level.