pgsql: At update of non-LP_NORMAL TID, fail instead of corrupting page - Mailing list pgsql-committers

From Noah Misch
Subject pgsql: At update of non-LP_NORMAL TID, fail instead of corrupting page
Date
Msg-id E1tblqs-003VM4-3y@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
At update of non-LP_NORMAL TID, fail instead of corrupting page header.

The right mix of DDL and VACUUM could corrupt a catalog page header such
that PageIsVerified() durably fails, requiring a restore from backup.
This affects only catalogs that both have a syscache and have DDL code
that uses syscache tuples to construct updates.  One of the test
permutations shows a variant not yet fixed.

This makes !TransactionIdIsValid(TM_FailureData.xmax) possible with
TM_Deleted.  I think core and PGXN are indifferent to that.

Per bug #17821 from Alexander Lakhin.  Back-patch to v13 (all supported
versions).  The test case is v17+, since it uses INJECTION_POINT.

Discussion: https://postgr.es/m/17821-dd8c334263399284@postgresql.org

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9311fcb8648075782f59d534010352264bf8dc54

Modified Files
--------------
src/backend/access/heap/heapam.c | 47 +++++++++++++++++++++++++++++++++++++++-
src/include/access/tableam.h     |  3 ++-
2 files changed, 48 insertions(+), 2 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Doc: recommend "psql -X" for restoring pg_dump scripts.
Next
From: Álvaro Herrera
Date:
Subject: pgsql: Add missing CommandCounterIncrement