pgsql: Fix WAL file selection in 013_rewind test

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix WAL file selection in 013_rewind test
Date: 2026-09-28 15:49:06
Message-ID: E1xBDbG-00000001d1F-1M71@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix WAL file selection in 013_rewind test

Without an explicit WAL filename, pg_waldump determines the segment
size from the first WAL-named directory entry. A preallocated
segment with an uninitialized header can make this fail before the
checkpoint is read.

Pass the WAL filename recorded in backup_label to avoid depending
on directory enumeration order. Use command_like() so command
failures and stderr are checked rather than appearing only as an
empty-output mismatch.

This was independently reported by Nazir Bilal Yavuz and Alexander
Lakhin.

Author: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
Reported-by: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
Reported-by: Alexander Lakhin <exclusion(at)gmail(dot)com>
Reviewed-by: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Reviewed-by: Daniel Gustafsson <daniel(at)yesql(dot)se>
Discussion: https://postgr.es/m/CAN55FZ1Yak_xBqMaDQsD7atpBkGLEkF-DKXcs3nLHM1Uq4YRew%40mail.gmail.com
Discussion: https://postgr.es/m/ffd837c5-dc22-4db1-a2d8-b623cbe9b30c@gmail.com

Branch
------
master

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

Modified Files
--------------
src/test/modules/test_checksums/t/013_rewind.pl | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2026-09-28 18:47:16 pgsql: Fire create_upper_paths_hook for UPPERREL_PARTIAL_GROUP_AGG
Previous Message Álvaro Herrera 2026-09-28 15:43:00 pgsql: Turn "check" into assertion