Re: HOT chain validation in verify_heapam()
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Aleksander Alekseev <aleksander@timescale.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Himanshu Upadhyaya <upadhyaya.himanshu@gmail.com>,
Mark Dilger <mark.dilger@enterprisedb.com>, Andres Freund <andres@anarazel.de>
Date: 2023-03-23T13:42:16Z
Lists: pgsql-hackers
On Wed, Mar 22, 2023 at 3:27 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> My animal mamba doesn't like this one bit.
>
> I suspect the reason is that it's big-endian (PPC) and the endianness
> hacking in the test is simply wrong:
>
> syswrite($file,
> pack("L", $ENDIANNESS eq 'little' ? 0x00010019 : 0x19000100))
> or BAIL_OUT("syswrite failed: $!");
>
> pack's L code should already be performing an endianness swap, so why
> are we doing another one in the argument?
(Apologies for having missed responding to this yesterday afternoon.)
Hmph. I didn't think very hard about that code and just assumed
Himanshu had tested it. I don't have convenient access to a Big-endian
test machine myself. Are you able to check whether using 0x00010019
unconditionally works?
I think part of the reason that I thought this looked OK was because
there are other places in this test case that do stuff differently
based on endian-ness, but now that you mention it, I realize that
stuff has to do with the varlena representation, which is
endian-dependent in a way that the ItemIdData representation is not.
--
Robert Haas
EDB: http://www.enterprisedb.com
Commits
-
amcheck: Generalize one of the recently-added update chain checks.
- c87aff065c33 16.0 landed
-
amcheck: Tighten up validation of redirect line pointers.
- 80d5e3a61551 16.0 landed
-
amcheck: Fix verify_heapam for tuples where xmin or xmax is 0.
- 8fd5aa76c367 14.8 landed
- 701ec5557968 15.3 landed
- e88754a1965c 16.0 landed
-
amcheck: Fix a few bugs in new update chain validation.
- 949e2e7c4f68 16.0 landed
-
Fix new test case to work on (some?) big-endian architectures.
- c75a623304bc 16.0 landed
-
Don't test HEAP_XMAX_INVALID when freezing xmax.
- 02d647bbf057 16.0 landed