Re: pg_rewind WAL segments deletion pitfall
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: cyberdemn@gmail.com
Cc: bungina@gmail.com, pgsql-hackers@lists.postgresql.org
Date: 2022-08-30T07:51:31Z
Lists: pgsql-bugs, 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
Commits
-
Fix newly introduced 010_keep_recycled_wals.pl
- 2fb3919356fb 17.3 landed
- 50010c6f6c4d 16.7 landed
- 93d8d4fe1255 15.11 landed
- 1c5fe56bc259 14.16 landed
- b5be29ecafe1 18.0 landed
-
Avoid deleting critical WAL segments during pg_rewind
- ea1649c352f6 16.6 landed
- e28cf2fbc222 15.10 landed
- cb844d66b587 17.2 landed
- ba25358413e4 14.15 landed
- 90bcc7c2db1d 18.0 landed