]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Advance restart_lsn more eagerly in LogicalConfirmReceivedLocation
authorÁlvaro Herrera <alvherre@kurilemu.de>
Fri, 29 May 2026 19:10:01 +0000 (21:10 +0200)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Fri, 29 May 2026 19:10:01 +0000 (21:10 +0200)
commit38470c2c1ea7dc0971d7abf65ef1dde80824ef43
tree4c1ec6a6670d27e43fb426d98134f47f5bd4a5b7
parent5d48d3b14e0e3a46e93b9f71b47205bebaab4b0e
Advance restart_lsn more eagerly in LogicalConfirmReceivedLocation

The existing logic computed an updated replicationSlotMinLSN from all
slots' restart_lsn only when catalog_xmin also advanced.  This is not a
problem in normal (non-repack) cases, because catalog_xmin changes
pretty frequently, so the recomputation is triggered frequently enough.
However, REPACK does not currently change its catalog snapshot, so that
doesn't work very well if no other replication slot is being used.

(After this commit, we still don't recycle WAL properly for REPACK,
because its background worker is not advancing its restart_lsn either;
that will be fixed in a separate commit.  However, this preexisting
problem in older code is logically separate from that one.)

Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Discussion: https://postgr.es/m/TY4PR01MB17718B44164522D0798F8E898940A2@TY4PR01MB17718.jpnprd01.prod.outlook.com
src/backend/replication/logical/logical.c