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: Stop WAL streaming on timeline history file write failures
Date: Wed, 18 Nov 2026 04:32:19 +0000
Message-ID: <E1xTXLG-00000000BgU-2zpA@gemulon.postgresql.org> (raw)

Stop WAL streaming on timeline history file write failures

pg_basebackup and pg_receivewal could continue streaming WAL after
failing to write a timeline history file, leaving the backup or WAL
archive without a file needed for recovery.

ReceiveXlogStream() ignored the return value of
writeTimeLineHistoryFile(), which reports errors and returns false
on failure. Check the return value and stop the current streaming
attempt if the write fails.

Backpatch to all supported versions.

Author: Chao Li <lic@highgo.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Surya Poondla <suryapoondla4@gmail.com>
Discussion: https://postgr.es/m/530B55ED-C7F7-441C-BBC0-6F3F9901E414@gmail.com
Backpatch-through: 15

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/65efcf45768c3eb3f91191e8191820da87f72aa6

Modified Files
--------------
src/bin/pg_basebackup/receivelog.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1xTXLG-00000000BgU-2zpA@gemulon.postgresql.org>
Permalink:  ../E1xTXLG-00000000BgU-2zpA@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xTXLG-00000000BgU-2zpA@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: Stop WAL streaming on timeline history file write failures
  In-Reply-To: <E1xTXLG-00000000BgU-2zpA@gemulon.postgresql.org>
  References: <E1xTXLG-00000000BgU-2zpA@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