Re: pgsql: amcheck: Fix verify_heapam for tuples where xmin or xmax is 0.
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: Robert Haas <rhaas@postgresql.org>
Cc: pgsql-committers@lists.postgresql.org
Date: 2023-03-25T22:24:34Z
Lists: pgsql-hackers
On Fri, Mar 24, 2023 at 8:13 AM Robert Haas <rhaas@postgresql.org> wrote: > If we're checking xmin and find that it is invalid (i.e. 0) just > report that as corruption, similar to what's already done in the > three cases that seem correct. If we're checking xmax and find > that's invalid, that's fine: it just means that the tuple hasn't > been updated or deleted. What about aborted speculative insertions? See heap_abort_speculative(), which directly sets the speculatively inserted heap tuple's xmin to InvalidTransactionId/zero. It probably does make sense to keep something close to this check -- it just needs to account for speculative insertions to avoid false positive reports of corruption. We could perform cross-checks against a tuple whose xmin is InvalidTransactionId/zero to verify that it really is from an aborted speculative insertion, to the extent that that's possible. For example, such a tuple can't be a heap-only tuple, and it can't have any xmax value other than InvalidTransactionId/zero. -- Peter Geoghegan
Commits
-
amcheck: In verify_heapam, allows tuples with xmin 0.
- e3363cda9cb6 14.8 landed
- 453f53821fa5 15.3 landed
- b7cea58822c6 16.0 landed
-
amcheck: Fix verify_heapam for tuples where xmin or xmax is 0.
- e88754a1965c 16.0 cited