RE: Wrong FOR UPDATE lock type - Mailing list pgsql-hackers

From Mikheev, Vadim
Subject RE: Wrong FOR UPDATE lock type
Date
Msg-id 8F4C99C66D04D4118F580090272A7A234D31C9@sectorbase1.sectorbase.com
Whole thread Raw
In response to Wrong FOR UPDATE lock type  (Jan Wieck <janwieck@yahoo.com>)
List pgsql-hackers
> Well, there is a theoretical chance of deadlock --- not against other
> transactions doing the same thing, since RowShareLock and
> RowExclusiveLock don't conflict, but you could construct deadlock
> scenarios involving other transactions that grab ShareLock or
> ShareRowExclusiveLock.  So I don't think it's appropriate for the
> "deadlock risk" check to ignore RowShareLock->RowExclusiveLock
> upgrades.

There is theoretical chance of deadlock when two xactions lock
tables in different order and we can check this only in deadlock
detection code.

> But I'm not sure the check should be enabled in production releases
> anyway.  I just put it in as a quick and dirty debug check.  Perhaps
> it should be under an #ifdef that's not enabled by default.

No reason to learn users during transaction processing. We need in
good deadlock detection code and documentation.

Vadim


pgsql-hackers by date:

Previous
From: "Mikheev, Vadim"
Date:
Subject: RE: beta testing version
Next
From: "Martin A. Marques"
Date:
Subject: Re: beta testing version