From: | Alexander Korotkov <akorotkov(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Add TAP tests to check replication slot advance during the check |
Date: | 2025-06-14 01:29:20 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Add TAP tests to check replication slot advance during the checkpoint
The new tests verify that logical and physical replication slots are still
valid after an immediate restart on checkpoint completion when the slot was
advanced during the checkpoint.
This commit introduces two new injection points to make these tests possible:
* checkpoint-before-old-wal-removal - triggered in the checkpointer process
just before old WAL segments cleanup;
* logical-replication-slot-advance-segment - triggered in
LogicalConfirmReceivedLocation() when restart_lsn was changed enough to
point to the next WAL segment.
Discussion: https://postgr.es/m/flat/1d12d2-67235980-35-19a406a0%4063439497
Author: Vitaly Davydov <v(dot)davydov(at)postgrespro(dot)ru>
Author: Tomas Vondra <tomas(at)vondra(dot)me>
Reviewed-by: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Reviewed-by: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Backpatch-through: 17
Branch
------
REL_17_STABLE
Modified Files
--------------
src/backend/access/transam/xlog.c | 4 +
src/backend/replication/logical/logical.c | 18 +++
src/test/recovery/meson.build | 2 +
src/test/recovery/t/046_checkpoint_logical_slot.pl | 139 +++++++++++++++++++++
.../recovery/t/047_checkpoint_physical_slot.pl | 133 ++++++++++++++++++++
5 files changed, 296 insertions(+)
From | Date | Subject | |
---|---|---|---|
Next Message | Alexander Korotkov | 2025-06-14 01:29:26 | pgsql: Keep WAL segments by the flushed value of the slot's restart LSN |
Previous Message | Alexander Korotkov | 2025-06-14 01:28:57 | pgsql: Keep WAL segments by slot's last saved restart LSN |