Re: heap_update temporary release of buffer lock

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: heap_update temporary release of buffer lock
Date: 2011-09-27 12:24:47
Message-ID: CA+TgmoYOSW8Q+JozMJ0RNVKDo1YL7f8apszPvK-i3OnX+fG3fQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 20, 2011 at 3:47 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
>> Excerpts from Robert Haas's message of mar sep 20 16:04:03 -0300 2011:
>>>> On 20.09.2011 20:42, Alvaro Herrera wrote:
>>>>> I notice that heap_update releases the buffer lock, after checking the
>>>>> HeapTupleSatifiesUpdate result, and before marking the tuple as updated,
>>>>> to pin the visibility map page -- heapam.c lines 2638ff in master branch.
>
>>> The easiest fix seems to be (as you suggest) to add "goto l2" after
>>> reacquiring the lock.  Can we get away with (and is there any benefit
>>> to) doing that only if xmax has changed?
>
>> Hmm ... I think that works, and it would suit my purposes too.  Note
>> this means you have to recheck infomask too (otherwise consider that
>> IS_MULTI could be set the first time, and not set the second time, and
>> that makes the Xmax have a different meaning.)  OTOH if you just do it
>> always, it is simpler.
>
> Yeah, I think a "goto l2" is correct and sufficient.  As the comment
> already notes, this need not be a high-performance path, so why spend
> extra code (with extra risk of bugs)?

Done.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-09-27 12:38:36 Re: [v9.1] sepgsql - userspace access vector cache
Previous Message Florian Pflug 2011-09-27 11:28:00 Re: Postgresql parser