pgsql: Keep WAL segments by slot's last saved restart LSN

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема pgsql: Keep WAL segments by slot's last saved restart LSN
Дата
Msg-id E1uQFhZ-001YCB-2e@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Keep WAL segments by slot's last saved restart LSN

The patch fixes the issue with the unexpected removal of old WAL segments
after checkpoint, followed by an immediate restart.  The issue occurs when
a slot is advanced after the start of the checkpoint and before old WAL
segments are removed at the end of the checkpoint.

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

This fix changes the shared memory layout.  It's applied to HEAD only because
we don't have to preserve ABI compatibility during the beta stage.  Another
fix that doesn't affect the ABI is committed to back branches.

Discussion: https://postgr.es/m/1d12d2-67235980-35-19a406a0%4063439497
Author: Vitaly Davydov <v.davydov@postgrespro.ru>
Author: Alexander Korotkov <aekorotkov@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ca307d5cec90a4fde62a50fafc8ab607ff1d8664

Modified Files
--------------
src/backend/replication/slot.c | 57 ++++++++++++++++++++++++++++++++++++++++++
src/include/replication/slot.h |  8 ++++++
2 files changed, 65 insertions(+)


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