pgsql: Fix oldest xmin and LSN computation across repslots after advanc

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix oldest xmin and LSN computation across repslots after advanc
Date: 2020-06-18 07:36:28
Message-ID: E1jlp64-0001Rm-VL@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b48df818dcbd1a5e34ab7a2d9f98828b7b62140c

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

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2020-06-18 07:36:29 pgsql: Fix oldest xmin and LSN computation across repslots after advanc
Previous Message Peter Eisentraut 2020-06-18 06:41:58 pgsql: Expand tests for factorial