pgsql: Advance restart_lsn more eagerly in LogicalConfirmReceivedLocati

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Advance restart_lsn more eagerly in LogicalConfirmReceivedLocati
Date: 2026-05-29 19:10:34
Message-ID: E1wT2bJ-000A1k-2V@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

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(dot)fnst(at)fujitsu(dot)com>
Reviewed-by: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Discussion: https://postgr.es/m/TY4PR01MB17718B44164522D0798F8E898940A2@TY4PR01MB17718.jpnprd01.prod.outlook.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/38470c2c1ea7dc0971d7abf65ef1dde80824ef43

Modified Files
--------------
src/backend/replication/logical/logical.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-05-29 19:29:12 pgsql: Constistent naming for datacheckusms processes
Previous Message Álvaro Herrera 2026-05-29 18:55:38 pgsql: Remove unnecessary signal handler change

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2026-05-29 19:24:30 Re: Fix race during concurrent logical decoding activation
Previous Message Jacob Champion 2026-05-29 18:49:34 Re: PSA: Planning to grease protocol connections during 19beta