Re: HOT chain validation in verify_heapam()
Himanshu Upadhyaya <upadhyaya.himanshu@gmail.com>
From: Himanshu Upadhyaya <upadhyaya.himanshu@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, Peter Geoghegan <pg@bowt.ie>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
Andrew Dunstan <andrew@dunslane.net>, Mark Dilger <mark.dilger@enterprisedb.com>
Date: 2022-09-19T08:28:03Z
Lists: pgsql-hackers
Attachments
- v3-0001-HOT-chain-validation-in-verify_heapam.patch (text/x-patch) patch v3-0001
On Wed, Sep 7, 2022 at 2:49 AM Robert Haas <robertmhaas@gmail.com> wrote: > > But here's one random idea: add a successor[] array and an lp_valid[] > array. In the first loop, set lp_valid[offset] = true if it passes the > check_lp() checks, and set successor[A] = B if A redirects to B or has > a CTID link to B, without matching xmin/xmax. Then, in a second loop, > iterate over the successor[] array. If successor[A] = B && lp_valid[A] > && lp_valid[B], then check whether A.xmax = B.xmin; if so, then > complain if predecessor[B] is already set, else set predecessor[B] = > A. Then, in the third loop, iterate over the predecessor array just as > you're doing now. Then it's clear that we do the lp_valid checks > exactly once for every offset that might need them, and in order. And > it's also clear that the predecessor-based checks can never happen > unless the lp_valid checks passed for both of the offsets involved. > > ok, I have introduced a new approach to first construct a successor array and then loop over the successor array to construct a predecessor array. -- Regards, Himanshu Upadhyaya EnterpriseDB: 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