Re: comments around heap_lock_tuple confus{ing,ed} around deleted tuples

From: Andres Freund <andres(at)anarazel(dot)de>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: comments around heap_lock_tuple confus{ing,ed} around deleted tuples
Date: 2018-04-04 21:44:42
Message-ID: 20180404214442.zakck6rssdhiyn3p@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2018-04-04 18:34:26 -0300, Alvaro Herrera wrote:
> > It's also fairly weird that heap_lock_updated_tuple() returns
> > /* nothing to lock */
> > return HeapTupleMayBeUpdated;
> > when the tuple has been deleted (and thus
> > ItemPointerEquals(&tuple->t_self, ctid)). That'll not get returned by
> > heap_lock_tuple() itself, but seems thoroughly confusing.
>
> Yeah, what MayBeUpdated is supposed to mean in this case is "there is no
> error, we were able to do the thing we were asked to do", rather than
> exactly "yes, you may update the tuple". I guess you could argue that
> reusing HTSU result values for it was wrong. It was certainly
> convenient.

I think just adding a comment along those lines should be good enough...

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2018-04-04 22:09:11 Re: WIP: Covering + unique indexes.
Previous Message Alvaro Herrera 2018-04-04 21:34:26 Re: comments around heap_lock_tuple confus{ing,ed} around deleted tuples