Re: HOT chain validation in verify_heapam()
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Himanshu Upadhyaya <upadhyaya.himanshu@gmail.com>, Aleksander Alekseev <aleksander@timescale.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2022-11-15T19:50:05Z
Lists: pgsql-hackers
Hi, On 2022-11-15 11:36:21 -0500, Robert Haas wrote: > On Mon, Nov 14, 2022 at 5:02 PM Andres Freund <andres@anarazel.de> wrote: > > It seems like we should do a bit more validation within a chain of > > tuples. E.g. that no live tuple can follow an !DidCommit xmin? > > I think this check is already present in stronger form. If we see a > !DidCommit xmin, the xmin of the next tuple in the chain not only can't be > committed, but had better be the same. As I think I mentioned before, I don't think the "better be the same" aspect is correct, think subxacts. E.g. off 0: xmin: top, xmax: child_1 off 1: xmin: child_1, xmax: invalid If top hasn't committed yet, the current logic afaict will warn about this situation, no? And I don't think we can generally the subxid parent at this point, unfortunately (might have truncated subtrans). Different aspect: Is it ok that we use TransactionIdDidCommit() without a preceding IsInProgress() check? I do think there's some potential for additional checks that don't run into the above issue, e.g. checking that no in-progress xids follow an explicitly aborted xact, that a committed xid can't follow an uncommitted xid etc. 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