Re: HOT chain validation in verify_heapam()
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Himanshu Upadhyaya <upadhyaya.himanshu@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Aleksander Alekseev <aleksander@timescale.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2022-11-17T17:53:52Z
Lists: pgsql-hackers
Hi, On 2022-11-17 21:33:17 +0530, Himanshu Upadhyaya wrote: > On Tue, Nov 15, 2022 at 3:32 AM Andres Freund <andres@anarazel.de> wrote: > > > Furthermore, it is > > > possible that successor[x] = successor[x'] since the page might be > > corrupted > > > and we haven't checked otherwise. > > > > > > predecessor[y] = x means that successor[x] = y but in addition we've > > > checked that y is sane, and that x.xmax=y.xmin. If there are multiple > > > tuples for which these conditions hold, we've issued complaints about > > > all but one and entered the last into the predecessor array. > > > > As shown by the isolationtester test I just posted, this doesn't quite work > > right now. Probably fixable. > > > > I don't think we can follow non-HOT ctid chains if they're older than the > > xmin > > horizon, including all cases of xmin being frozen. There's just nothing > > guaranteeing that the tuples are actually "related". > > > I understand the problem with frozen tuples but don't understand the > concern with non-HOT chains, > could you please help with some explanation around it? I think there might be cases where following non-HOT ctid-chains across tuples within a page will trigger spurious errors, if the tuple versions are older than the xmin horizon. But it's a bit hard to say without seeing the code with a bunch of the other bugs fixed. Greetings, Andres Freund
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