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 <[email protected]>
Reviewed-by: Fujii Masao <[email protected]>
Reviewed-by: Surya Poondla <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 15

Branch
------
REL_15_STABLE

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

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

Reply via email to