Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly

Поиск
Список
Период
Сортировка
От Vitaly Davydov
Тема Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly
Дата
Msg-id 1538a2-67c5c700-7-77ec5a80@179382871
обсуждение исходный текст
Ответ на Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly  ("Vitaly Davydov" <v.davydov@postgrespro.ru>)
Ответы Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly
Список pgsql-hackers
Dear Hackers,

Let me please introduce a new version of the patch.

Patch description:

The slot data is flushed to the disk at the beginning of checkpoint. If
an existing slot is advanced in the middle of checkpoint execution, its
advanced restart LSN is taken to calculate the oldest LSN for WAL
segments removal at the end of checkpoint. If the node is restarted just
after the checkpoint, the slots data will be read from the disk at
recovery with the oldest restart LSN which can refer to removed WAL
segments.

The patch introduces a new in-memory state for slots -
flushed_restart_lsn which is used to calculate the oldest LSN for WAL
segments removal. This state is updated every time with the current
restart_lsn at the moment, when the slot is saving to disk.

With best regards,
Vitaly

Вложения

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