Re: Possible missing segments in archiving on standby

Fujii Masao <masao.fujii@oss.nttdata.com>

From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2021-09-08T13:41:43Z
Lists: pgsql-hackers

Attachments


On 2021/09/08 16:40, Kyotaro Horiguchi wrote:
> No. The discussion taken there is not about permanently missing .ready
> files, but about .ready files created out-of-order.  So I don't think
> the outcome from the thread does *fix* this issue.

Hmm...

> I don't think we want such extent of perfectness at all for the case
> where some archive-related parameters are changed after a
> crash. Anyway we need to take a backup after that and at least all
> segments required for the backup will be properly archived.  The
> segments up to the XLOG_SWITCH segment are harmless garbage, or a bit
> of food for disk.

So probably we reached the consensus that something like the attached patch
(XLogArchiveCheckDone_walfile_xlog_switch.patch) is enough for the corner
case where walreceiver fails to create .ready file of WAL file including
XLOG_SWITCH?

> Sounds convincing.  Ok, I agree to that.

So barring any objection, I will commit the patch
and back-patch it to all supported version.

walreceiver_notify_archive_soon_v5.patch
walreceiver_notify_archive_soon_v5_pg14-13.patch
walreceiver_notify_archive_soon_v5_pg12-11.patch
walreceiver_notify_archive_soon_v5_pg10.patch
walreceiver_notify_archive_soon_v5_pg96.patch

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

Commits

  1. Fix issue with WAL archiving in standby.