Re: Repeated PredicateLockRelation calls during seqscan

Lists: pgsql-hackers
From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <drkp(at)csail(dot)mit(dot)edu>,<heikki(dot)linnakangas(at)enterprisedb(dot)com>, "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Repeated PredicateLockRelation calls during seqscan
Date: 2011-06-26 20:49:35
Message-ID: 4E07550F020000250003EC42@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Kevin Grittner" wrote:
> "Kevin Grittner" wrote:
>> Heikki Linnakangas wrote:

>>> BTW, isn't bitgetpage() in nodeBitmapHeapscan.c missing
>>> PredicateLockTuple() and CheckForSerializableConflictOut() calls
>>> in the codepath for a lossy bitmap? In the non-lossy case,
>>> heap_hot_search_buffer() takes care of it, but not in the lossy
>>> case.
>>
>> I think the attached addresses that.
>
> Don't commit that patch, it's not holding up in testing here.
>
> I'll look at it some more.

Version 2 is attached. It initializes some data which was
uninitialized in a HeapTableData structure which already existed in
the code. I've been burned by this before -- making a seemingly
innocuous change to code which then fails because the comments at
lines 512 to 514 in htup.h are not actually true:

http://git.postgresql.org/gitweb?p=postgresql.git;a=blob;f=src/include/access/htup.h;h=ba5d9b28ef19f3054191cf0f8b358ac5831a9e26;hb=8af3596d6bb6cfffb57161a62aa2f7f56d5ea3eb#l504

I asked about this the first time it bit me in this thread:

http://archives.postgresql.org/pgsql-hackers/2010-03/msg00493.php

which concluded here:

http://archives.postgresql.org/pgsql-hackers/2010-03/msg00506.php

Having been bitten by it a *second* time now, I'm inclined to go
through and make the code match the comments wherever these
structures are used. It's a bit late in the cycle to do that for
9.1, but I'll get something on the table for 9.2 if nobody wants to
argue against that course.

-Kevin

Attachment Content-Type Size
ssi-lossy-bitmap-2.patch application/octet-stream 1.5 KB

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: drkp(at)csail(dot)mit(dot)edu, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Repeated PredicateLockRelation calls during seqscan
Date: 2011-06-29 19:19:11
Message-ID: 4E0B7AAF.10903@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 26.06.2011 23:49, Kevin Grittner wrote:
> "Kevin Grittner" wrote:
>> "Kevin Grittner" wrote:
>>> Heikki Linnakangas wrote:
>
>>>> BTW, isn't bitgetpage() in nodeBitmapHeapscan.c missing
>>>> PredicateLockTuple() and CheckForSerializableConflictOut() calls
>>>> in the codepath for a lossy bitmap? In the non-lossy case,
>>>> heap_hot_search_buffer() takes care of it, but not in the lossy
>>>> case.
>>>
>>> I think the attached addresses that.
>>
>> Don't commit that patch, it's not holding up in testing here.
>>
>> I'll look at it some more.
>
> Version 2 is attached.

Thanks, applied this too.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com