At Tue, 30 Aug 2022 08:49:27 +0200, Alexander Kukushkin <cyberd...@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