From: | Claudio Freire <klaussfreire(at)gmail(dot)com> |
---|---|
To: | Peter Geoghegan <pg(at)heroku(dot)com> |
Cc: | Stephen Frost <sfrost(at)snowman(dot)net>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: DDL Damage Assessment |
Date: | 2014-10-02 20:52:29 |
Message-ID: | CAGTBQpZhTEFFN0TNFHrPoRgbMch-kBuCLz14-qQtmtE7pN51ZA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Oct 2, 2014 at 5:37 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> Session 3 is an innocent bystander. It goes to query the same table in
> an ordinary, routine way - a SELECT statement. Even though session 2's
> lock is not granted yet, session 3 is not at liberty to skip the queue
> and get its own AccessShareLock. The effect is about the same as if
> session 2 did need to hold an AccessExclusiveLock for ages: read
> queries block for a long time. And yet, in theory session 2's impact
> on production should not be minimal, if we consider something like
> EXPLAIN output.
The explain would show the AccessExclusiveLock, so it would be enough
for a heads-up to kill all idle-in-transaction holding locks on the
target relation (if killable, or just wait).
Granted, it's something that's not easily automatable, whereas a nowait is.
However, rather than nowait, I'd prefer "cancellable" semantics, that
would cancel voluntarily if any other transaction requests a
conflicting lock, like autovacuum does.
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Geoghegan | 2014-10-02 21:00:06 | Re: DDL Damage Assessment |
Previous Message | Peter Geoghegan | 2014-10-02 20:38:33 | Re: DDL Damage Assessment |