Re: pg_rewind WAL segments deletion pitfall

Поиск
Список
Период
Сортировка
От Alexander Kukushkin
Тема Re: pg_rewind WAL segments deletion pitfall
Дата
Msg-id CAFh8B=mDMoRTVRa=Ke4OQOJrj8boJi6ARiF9knOHtjFvraVi_Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_rewind WAL segments deletion pitfall  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы Re: pg_rewind WAL segments deletion pitfall  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers
Hello Kyotaro,


On Tue, 30 Aug 2022 at 09:51, Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote:


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.

What if the last common checkpoint was on a previous timeline?
I.e., standby was promoted to primary, the timeline changed from 1 to 2, and after that the node crashed _before_ the CHECKPOINT after promote has finished.
The next node will advance the timeline from 2 to 3.
In this case, the last common checkpoint will be on timeline 1, and the check becomes more complex because we will have to consider both timelines, 1 and 2.

Also, we need to take into account the divergency LSN. Files after it are not required.

Regards,
--
Alexander Kukushkin

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Fix japanese translation of log messages
Следующее
От: Amit Langote
Дата:
Сообщение: Re: SQL/JSON features for v15