Re: group locking: incomplete patch, just for discussion

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: group locking: incomplete patch, just for discussion
Date: 2014-11-13 20:43:39
Message-ID: 824FF69B-501A-4D5F-B74B-42D4AE6777F4@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On November 13, 2014 8:50:18 PM CET, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Thu, Nov 13, 2014 at 3:38 AM, Jeff Davis <pgsql(at)j-davis(dot)com>
>wrote:
>>> If two backends both have an exclusive lock on the relation for a
>join
>>> operation, that implies that they need to do their own
>synchronization,
>>> because obviously the lock manager is not doing it for them.
>
>> This doesn't make sense to me. Why would they need to synchronize
>> access to a relation in order to join it?
>
>What's more to the point: why would you take an exclusive lock just to
>do a join?

Robert's case basically rest on the premise that it's useful & correct when normally conflicting locks don't conflict when normal processes and its workers acquire them. I have serious doubts about the safety of that and the complexity it requires.

Obviously a join won't need an exclusive lock itself - but with Robert's design a join inside a transaction that locked a relation could still be parallelized, even if that rel is involved.

Andred

--
Please excuse brevity and formatting - I am writing this on my mobile phone.

Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-11-13 20:59:11 alternative model for handling locking in parallel groups
Previous Message Alvaro Herrera 2014-11-13 20:35:13 Re: alter user/role CURRENT_USER