]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Advance old-segment horizon properly after slot invalidation
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 16 Jul 2021 16:07:30 +0000 (12:07 -0400)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 16 Jul 2021 16:07:30 +0000 (12:07 -0400)
commite5bcbb10707b844471c67d5e5fd8226d1891ee97
treed8a9de7bc71b693bcdc72836020b9ece683e237e
parent525115a332af0fd479503550fd4f82551b797aea
Advance old-segment horizon properly after slot invalidation

When some slots are invalidated due to the max_slot_wal_keep_size limit,
the old segment horizon should move forward to stay within the limit.
However, in commit c6550776394e we forgot to call KeepLogSeg again to
recompute the horizon after invalidating replication slots.  In cases
where other slots remained, the limits would be recomputed eventually
for other reasons, but if all slots were invalidated, the limits would
not move at all afterwards.  Repair.

Backpatch to 13 where the feature was introduced.

Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reported-by: Marcin Krupowicz <mk@071.ovh>
Discussion: https://postgr.es/m/17103-004130e8f27782c9@postgresql.org
src/backend/access/transam/xlog.c
src/backend/replication/slot.c
src/include/replication/slot.h
src/test/recovery/t/019_replslot_limit.pl