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/[email protected] Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/
v1-0001-Check-timeline-history-file-write-failures-in-Rec.patch
Description: Binary data
