pg_basebackup: check timeline history file write failures in ReceiveXlogStream()

Поиск
Список
Период
Сортировка
Искать

pg_basebackup: check timeline history file write failures in ReceiveXlogStream()

От:
Chao Li <li.evan.chao@gmail.com>
Дата:
Вложения:
Hi,

While reviewing patch [1], I spotted that ReceiveXlogStream() calls writeTimeLineHistoryFile() without checking its result. writeTimeLineHistoryFile() can fail for several reasons and returns false to indicate a failure. This could cause pg_basebackup and pg_receivewal to continue streaming even if the timeline history file was not successfully written.

This seems a very old problem, dating back to 9.3.

Attached is a trivial patch that checks the return value of writeTimeLineHistoryFile() and returns false on failure.

[1] https://postgr.es/m/f1743511-5fab-482e-94ec-1198ce18723e@riseup.net

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/




Re: pg_basebackup: check timeline history file write failures in ReceiveXlogStream()

От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
On Wed, Nov 11, 2026 at 10:56 AM Chao Li  wrote:
> Attached is a trivial patch that checks the return value of writeTimeLineHistoryFile() and returns false on failure.

Thanks for the report and patch! LGTM.
Barring any objections, I will commit it.

Regards,

-- 
Fujii Masao


Re: pg_basebackup: check timeline history file write failures in ReceiveXlogStream()

От:
surya poondla <suryapoondla4@gmail.com>
Дата:
Hi Chao,

Thank you for reporting the issue and fixing it. The patch looks good to me. 

Regards,
Surya Poondla

Re: pg_basebackup: check timeline history file write failures in ReceiveXlogStream()

От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
On Sat, Nov 14, 2026 at 7:21 AM surya poondla  wrote:
> Thank you for reporting the issue and fixing it. The patch looks good to me.

I've pushed the patch. Thanks!

Regards,

-- 
Fujii Masao


Re: pg_basebackup: check timeline history file write failures in ReceiveXlogStream()

От:
Chao Li <li.evan.chao@gmail.com>
Дата:


> On Nov 18, 2026, at 12:34, Fujii Masao  wrote:
> 
> On Sat, Nov 14, 2026 at 7:21 AM surya poondla  wrote:
>> Thank you for reporting the issue and fixing it. The patch looks good to me.
> 
> I've pushed the patch. Thanks!
> 

Hi Fujii-san, thanks a lot for pushing.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/






FAQ