pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Melanie Plageman <melanieplageman@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Forget invalid VM pages during truncation replay
Date: Thu, 19 Nov 2026 22:22:18 +0000
Message-ID: <E1xUAWH-00000000RHh-1QYX@gemulon.postgresql.org> (raw)

Forget invalid VM pages during truncation replay

Commit ed62d26caca made heap records that clear visibility map bits
register VM blocks, causing redo to read those blocks with RBM_NORMAL.
If such a record is replayed after the VM fork was already truncated on
disk, recovery records a missing-page reference. Replaying the
truncation only forgot missing pages from the main fork, so recovery
later PANICs with unresolved invalid pages.

Call XLogTruncateRelation() for the VM fork when replaying a VM
truncation.

Reported-by: Jacky Nguyen <nktpro@gmail.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Shihao Zhong <zhong950419@gmail.com>
Reviewed-by: Rahul Yadav <rahul@rhyadav.dev>
Discussion: https://postgr.es/m/CAL4mQLAp562c1rCgg2Dqx6TBSdOk6vOvaLFjwFG9E6k4uwvJJw%40mail.gmail.com
Backpatch-through: 17

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/abfd5b9d95a05be64bf2b390afaf304f9e147051

Modified Files
--------------
.../pg_visibility/t/001_concurrent_transaction.pl  | 62 ++++++++++++++++++++--
src/backend/catalog/storage.c                      | 12 ++++-
2 files changed, 69 insertions(+), 5 deletions(-)



view thread (4+ messages)

Message-ID: <E1xUAWH-00000000RHh-1QYX@gemulon.postgresql.org>
Permalink:  ../E1xUAWH-00000000RHh-1QYX@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xUAWH-00000000RHh-1QYX@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: melanieplageman@gmail.com
  Subject: Re: pgsql: Forget invalid VM pages during truncation replay
  In-Reply-To: <E1xUAWH-00000000RHh-1QYX@gemulon.postgresql.org>
  References: <E1xUAWH-00000000RHh-1QYX@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