pgsql: Save slot's restart_lsn when invalidated due to size

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Save slot's restart_lsn when invalidated due to size
Date: 2020-06-24 18:16:40
Message-ID: E1jo9wu-0007JS-Gc@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Save slot's restart_lsn when invalidated due to size

We put it aside as invalidated_at, which let us show "lost" in
pg_replication slot. Prior to this change, the state value was reported
as NULL.

Backpatch to 13.

Author: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Reviewed-by: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Discussion: https://postgr.es/m/20200617.101707.1735599255100002667.horikyota.ntt@gmail.com
Discussion: https://postgr.es/m/20200407.120905.1507671100168805403.horikyota.ntt@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0188bb82531f1b0ae3648fb81a4bd4a4f6242127

Modified Files
--------------
src/backend/replication/slot.c | 1 +
src/backend/replication/slotfuncs.c | 11 ++++++++++-
src/include/access/xlog.h | 2 +-
src/include/replication/slot.h | 3 +++
src/test/recovery/t/019_replslot_limit.pl | 2 +-
5 files changed, 16 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2020-06-24 18:24:51 pgsql: Adjust max_slot_wal_keep_size behavior per review
Previous Message Alvaro Herrera 2020-06-24 18:01:26 pgsql: Add parens to ConvertToXSegs macro