Re: pg_rewind WAL segments deletion pitfall - Mailing list pgsql-hackers

From Kyotaro Horiguchi
Subject Re: pg_rewind WAL segments deletion pitfall
Date
Msg-id 20220830.165131.1873011317661150194.horikyota.ntt@gmail.com
Whole thread Raw
In response to Re: pg_rewind WAL segments deletion pitfall  (Alexander Kukushkin <cyberdemn@gmail.com>)
Responses Re: pg_rewind WAL segments deletion pitfall
List pgsql-hackers
At Tue, 30 Aug 2022 08:49:27 +0200, Alexander Kukushkin <cyberdemn@gmail.com> wrote in 
> No, we are complaining exactly about WAL segments from the old timeline
> that are removed by pg_rewind.
> Those segments haven't been archived by the old primary and the new primary
> already recycled them.

Yeah, sorry for my thick skull but I finally got your point.

And as I said in a mail I sent just before, the patch looks too
complex.  How about just comparing WAL file name aginst the last
common checkpoint's tli and lsn? We can tell filemap.c about the last
checkpoint and decide_file_action can compare the file name with it.

It is sufficient to preserve WAL files if tli matches and the segment
number of the WAL file is equal to or later than the checkpoint
location.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Benoit Lobréau
Date:
Subject: Re: archive modules
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: Fix japanese translation of log messages