Re: group locking: incomplete patch, just for discussion

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: group locking: incomplete patch, just for discussion
Date: 2014-11-10 13:19:30
Message-ID: CA+TgmoaH8We+SXHPXa0d2J5qGMTYTyjFV2-kaV=w-rqWRqDtAA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 10, 2014 at 6:33 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> I think this logic can sometimes block processes from acquiring a lock
> which no one is holding. Assume Group-1 (G-1) is waiting on two locks
> (Lock L1 on Table T1 and Lock L2 on Table T2) which are held by
> unrelated processes P-2 and P-3 respectively; now P-3 releases the
> lock on table T-2 and cannot grant it to G-1 who is waiting on this lock
> because still L-1 lock cannot be granted to G-1.

That's not what I meant. I meant we shouldn't grant a lock *on a
particular object* to any process on the group until all lock requests
*for that object* can be granted. Waiting until every awaited lock in
the system can be granted in all requested modes would be really hard
to implement and probably have all kinds of problems (as you point out
here).

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-11-10 13:20:31 Re: psql tab completion: \c [ dbname [ username ] ]
Previous Message Petr Jelinek 2014-11-10 13:16:38 Re: Column/type dependency recording inconsistencies