Re: group locking: incomplete patch, just for discussion - Mailing list pgsql-hackers

From Robert Haas
Subject Re: group locking: incomplete patch, just for discussion
Date
Msg-id CA+TgmoYcDDRZdCLy_j1oJOTNDjkU2y8j9mOpgWtK3hgxFV6MCA@mail.gmail.com
Whole thread Raw
In response to Re: group locking: incomplete patch, just for discussion  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: group locking: incomplete patch, just for discussion  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
On Thu, Nov 20, 2014 at 12:19 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> Except that it opens us up for all kinds of concurrency bugs. I'm pretty
> strictly set against granting any self exclusive locks en-masse. If we
> do this by default for all granted locks when starting a worker backend
> it'll get *so* much harder to reason about correctness. Suddenly locks
> don't guarantee what they used to anymore. We'll e.g. not be able to
> rely that a CheckTableNotInUse() + AEL makes it safe to
> drop/rewrite/whatever a relation - even if that happens in the main
> backend.

Haven't I responded to this a few times already?

I see no way, even theoretically, that it can be sane for
CheckTableNotInUse() to succeed in a parallel context.  Ever.  If the
deadlock detector would kill the processes anyway, it doesn't matter,
because CheckTableNotInUse() should do it first, so that we get a
better error and without waiting for deadlock_timeout.  So any
scenario that's predicated on the assumption that CheckTableNotInUse()
will succeed in a parallel context is 100% unconvincing to me as an
argument for anything.

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



pgsql-hackers by date:

Previous
From: Albe Laurenz
Date:
Subject: Re: Functions used in index definitions shouldn't be changed
Next
From: Robert Haas
Date:
Subject: Re: Doing better at HINTing an appropriate column within errorMissingColumn()