Re: HOT chain validation in verify_heapam()

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Himanshu Upadhyaya <upadhyaya(dot)himanshu(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: HOT chain validation in verify_heapam()
Date: 2022-11-21 22:06:32
Message-ID: CAH2-Wz=NEj4DM7hi8LfaDeXx4wkxHRKArO2sr7EB5E=WDj_GiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 21, 2022 at 1:34 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> Hm. But to get to that point we already need to have decided that xmax
> is not a normal xid. Unhelpfully we reuse the 'xid' variable for xmax as
> well:
> xid = HeapTupleHeaderGetRawXmax(tuple);
>
> I don't really know the HEAP_XMAX_INVALID branch is trying to do. For
> one, xid already is set to HeapTupleHeaderGetRawXmax(), why is it
> refetching the value?

Right, that detail is correct, but still weird. And suggests that it
might not have been super well thought through.

> So it looks to me like this path should just test !TransactionIdIsValid(xid)?

Agreed. Plus there should be a comment that reminds you that this is a
normal regular transaction ID (easy to miss, because the initial "if"
block for Multis is rather large).

I will push something like that soon.

--
Peter Geoghegan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-11-21 22:09:03 Re: CI and test improvements
Previous Message Corey Huinker 2022-11-21 22:02:08 Re: psql: Add command to use extended query protocol