pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Advance old-segment horizon properly after slot invalidation
Date: Fri, 16 Jul 2021 16:10:48 +0000
Message-ID: <E1m4QQK-0007RB-Kz@gemulon.postgresql.org> (raw)

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

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/866237a6fa01a128325df41ad39b41ea3363c9a9

Modified Files
--------------
src/backend/access/transam/xlog.c         | 26 +++++++++++++++++++++++--
src/backend/replication/slot.c            | 26 ++++++++++++++++++++++---
src/include/replication/slot.h            |  2 +-
src/test/recovery/t/019_replslot_limit.pl | 32 +++++++++++++++++++++++++------
4 files changed, 74 insertions(+), 12 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1m4QQK-0007RB-Kz@gemulon.postgresql.org>
Permalink:  ../E1m4QQK-0007RB-Kz@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1m4QQK-0007RB-Kz@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Advance old-segment horizon properly after slot invalidation
  In-Reply-To: <E1m4QQK-0007RB-Kz@gemulon.postgresql.org>
  References: <E1m4QQK-0007RB-Kz@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox