Re: BUG #5952: SetRWConflict assertion failure - Mailing list pgsql-bugs

From Robert Haas
Subject Re: BUG #5952: SetRWConflict assertion failure
Date
Msg-id BANLkTikA4fwzp5kxRS+69o0=GfO=x+sE5Q@mail.gmail.com
Whole thread Raw
In response to Re: BUG #5952: SetRWConflict assertion failure  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: BUG #5952: SetRWConflict assertion failure  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-bugs
On Sun, Mar 27, 2011 at 3:18 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> "YAMAMOTO Takashi" =A0wrote:
>
>> Description: SetRWConflict assertion failure
>
>> SerializableXactHashLock relocking in CheckTargetForConflictsIn()
>> seems racy to me.
>
> You're right. =A0The attached patch should fix the assertion you hit.

This patch looks reasonable, but I'm a bit concerned about the chunk
immediately preceding the patched area.

When we do this:

                    LWLockRelease(SerializableXactHashLock);
                    LWLockRelease(partitionLock);
                    LWLockRelease(SerializablePredicateLockListLock);
                    LWLockAcquire(partitionLock, LW_SHARED);
                    LWLockAcquire(SerializableXactHashLock, LW_SHARED);

Don't we need to also reset nextpredlock to the head of the list?  I'm
assuming it's the partitionLock that's keeping the PREDICATELOCKs from
bouncing out from under us, so if we release it, aren't we potentially
point off into thin air?

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

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Non Win/*nix UTF-8 codepage not known to PostgreSQL developers?!
Next
From: "Kevin Grittner"
Date:
Subject: Re: BUG #5952: SetRWConflict assertion failure