Re: [HACKERS] Buildfarm failure and dubious coding in predicate.c - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [HACKERS] Buildfarm failure and dubious coding in predicate.c
Date
Msg-id CAEepm=2x6QaWZx7U7=exeSQJKBZbmRhH4AVAQYDx=Jik5W_C6g@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Buildfarm failure and dubious coding in predicate.c  (Thomas Munro <thomas.munro@enterprisedb.com>)
Responses Re: [HACKERS] Buildfarm failure and dubious coding in predicate.c
List pgsql-hackers
On Mon, Jul 24, 2017 at 11:51 AM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
> On Sun, Jul 23, 2017 at 8:32 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Meanwhile, it's still pretty unclear what happened yesterday on
>> culicidae.
>
> That failure is indeed baffling.  The only code that inserts
> (HASH_ENTER[_NULL]) into PredicateLockTargetHash:
>
> 1.  CreatePredicateLock().  I would be a bug if that ever tried to
> insert a { 0, 0, 0, 0 } tag, and in any case it holds
> SerializablePredicateLockListLock in LW_SHARED.
>
> 2.  TransferPredicateLocksToNewTarget(), which removes and restores
> the scratch entry and also explicitly inserts a transferred entry.  It
> asserts that it holds SerializablePredicateLockListLock and is called
> only by PredicateLockPageSplit() which acquires it in LW_EXCLUSIVE.
>
> 3.  DropAllPredicateLocksFromTable(), which removes and restores the
> scratch entry and also explicitly inserts a transferred entry.
> Acquires SerializablePredicateLockListLock in LW_EXCLUSIVE.

Ahh, I think I see it.  This is an EXEC_BACKEND build farm animal.
Theory: After the backend we see had removed the scratch entry and
before it had restored it, another backend started up and ran
InitPredicateLocks(), which inserted a new scratch entry without
interlocking.

-- 
Thomas Munro
http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Gilles Darold
Date:
Subject: Re: [HACKERS] Issue with circular references in VIEW
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Issue with circular references in VIEW