pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix oldest xmin and LSN computation across repslots after advanc
Date: Thu, 18 Jun 2020 07:36:28 +0000
Message-ID: <E1jlp64-0001Rq-W8@gemulon.postgresql.org> (raw)

Fix oldest xmin and LSN computation across repslots after advancing

Advancing a replication slot did not recompute the oldest xmin and LSN
values across replication slots, preventing resource removal like
segments not recycled at checkpoint time.  The original commit that
introduced the slot advancing in 9c7d06d never did the update of those
oldest values, and b0afdca removed this code.

This commit adds a TAP test to check segment recycling with advancing
for physical slots, enforcing an extra segment switch before advancing
to check if the segment gets correctly recycled after a checkpoint.

Reported-by: Andres Freund
Reviewed-by: Alexey Kondratov, Kyptaro Horiguchi
Discussion: https://postgr.es/m/20200609171904.kpltxxvjzislidks@alap3.anarazel.de
Backpatch-through: 11

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/16f43122d46fc1f39af3f46024495de0b27ba751

Modified Files
--------------
src/backend/replication/slotfuncs.c   |  7 +++++++
src/test/recovery/t/001_stream_rep.pl | 23 +++++++++++++++++++++--
2 files changed, 28 insertions(+), 2 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1jlp64-0001Rq-W8@gemulon.postgresql.org>
Permalink:  ../E1jlp64-0001Rq-W8@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jlp64-0001Rq-W8@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: michael@paquier.xyz
  Subject: Re: pgsql: Fix oldest xmin and LSN computation across repslots after advanc
  In-Reply-To: <E1jlp64-0001Rq-W8@gemulon.postgresql.org>
  References: <E1jlp64-0001Rq-W8@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