Re: LockAcquireExtended() dontWait vs weaker lock levels than already held

2022-03-22 Thread Robert Haas
On Tue, Mar 22, 2022 at 3:01 PM Andres Freund wrote: > We clearly already know how to compute whether a lock is "included" in > something we already hold - after all ProcSleep() successfully does so. > > Isn't it a pretty trivial test? Seems like it'd boil down to something like I don't mind you

Re: LockAcquireExtended() dontWait vs weaker lock levels than already held

2022-03-22 Thread Andres Freund
Hi, On 2022-03-22 14:20:55 -0400, Robert Haas wrote: > On Tue, Mar 22, 2022 at 1:43 PM Andres Freund wrote: > > When LockAcquireExtended(dontWait=false) acquires a lock where we already > > hold > > stronger lock and somebody else is also waiting for that lock, it goes > > through > > a fairly

Re: LockAcquireExtended() dontWait vs weaker lock levels than already held

2022-03-22 Thread Robert Haas
On Tue, Mar 22, 2022 at 1:43 PM Andres Freund wrote: > When LockAcquireExtended(dontWait=false) acquires a lock where we already hold > stronger lock and somebody else is also waiting for that lock, it goes through > a fairly circuitous path to acquire the lock: > > A conflicting lock is

LockAcquireExtended() dontWait vs weaker lock levels than already held

2022-03-22 Thread Andres Freund
Hi, When LockAcquireExtended(dontWait=false) acquires a lock where we already hold stronger lock and somebody else is also waiting for that lock, it goes through a fairly circuitous path to acquire the lock: A conflicting lock is detected: if (lockMethodTable->conflictTab[lockmode] &