pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: At update of non-LP_NORMAL TID, fail instead of corrupting page
Date: Sat, 25 Jan 2025 19:29:54 +0000
Message-ID: <E1tblqs-003VMN-6w@gemulon.postgresql.org> (raw)

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_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8bfd2cebab0adc6e8dd86c5d34462eea247f0bb6

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



view thread (6+ messages)  latest in thread

Message-ID: <E1tblqs-003VMN-6w@gemulon.postgresql.org>
Permalink:  ../E1tblqs-003VMN-6w@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tblqs-003VMN-6w@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: noah@leadboat.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: At update of non-LP_NORMAL TID, fail instead of corrupting page
  In-Reply-To: <E1tblqs-003VMN-6w@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox