pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix incorrect LSNs in WAL decoding error messages
Date: Tue, 03 Nov 2026 01:53:27 +0000
Message-ID: <E1xO3iJ-00000001sT8-25cx@gemulon.postgresql.org> (raw)

Fix incorrect LSNs in WAL decoding error messages

Commit 3f1ce97346 introduced a circular WAL decoding buffer,
allowing records to be decoded before they are consumed. However,
decoding error messages continued to report the location of the last
record consumed instead of the record that failed decoding. With
recovery prefetching, the reported location could be many records
behind the failing record, making WAL problems harder to diagnose.

Fix this by reporting the location of the record being decoded.
Errors now identify the failing record even with recovery prefetching,
making it easier to investigate malformed WAL during recovery or with
tools such as pg_waldump and pg_walinspect.

Backpatch to v15, where the WAL decoding buffer was introduced.

Author: Rahul Yadav <rahul@rhyadav.dev>
Reviewed-by: Surya Poondla <suryapoondla4@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/P2qIkq4--F-9@rhyadav.dev
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/01b3d24c41629c577ca172f3077ec7bfc2ca9bf3

Modified Files
--------------
src/backend/access/transam/xlogreader.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1xO3iJ-00000001sT8-25cx@gemulon.postgresql.org>
Permalink:  ../E1xO3iJ-00000001sT8-25cx@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xO3iJ-00000001sT8-25cx@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: fujii@postgresql.org
  Subject: Re: pgsql: Fix incorrect LSNs in WAL decoding error messages
  In-Reply-To: <E1xO3iJ-00000001sT8-25cx@gemulon.postgresql.org>
  References: <E1xO3iJ-00000001sT8-25cx@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