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: pg_waldump: Align WAL read error locations with other tools
Date: Tue, 03 Nov 2026 01:53:27 +0000
Message-ID: <E1xO3iJ-00000001sTA-2A7e@gemulon.postgresql.org> (raw)

pg_waldump: Align WAL read error locations with other tools

When reading WAL fails, pg_rewind and pg_walinspect report the
position where the failed read began, followed by the detailed error
message. In contrast, pg_waldump's "error in WAL record at ..."
prefix reported the position of the last successfully read record.
This was misleading because the prefix pointed to a successfully
read record rather than the start of the failed read.

Make pg_waldump report the position where the failed read began,
consistent with pg_rewind and pg_walinspect.

Note that this position usually identifies the start of the next
record, but may precede it when a page header must be skipped.
It may also differ from the actual error location when reading
a record that spans multiple pages. Nevertheless, it is consistent
with the other tools and less misleading than reporting the last
successfully read record.

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/30faf13889b14e1bdfd0b5883291f3297135ce02

Modified Files
--------------
src/bin/pg_waldump/pg_waldump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



Message-ID: <E1xO3iJ-00000001sTA-2A7e@gemulon.postgresql.org>
Permalink:  ../E1xO3iJ-00000001sTA-2A7e@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xO3iJ-00000001sTA-2A7e@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: pg_waldump: Align WAL read error locations with other tools
  In-Reply-To: <E1xO3iJ-00000001sTA-2A7e@gemulon.postgresql.org>
  References: <E1xO3iJ-00000001sTA-2A7e@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