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: Allow users to limit storage reserved by replication slots
Date: Tue, 07 Apr 2020 22:39:19 +0000
Message-ID: <E1jLwsJ-0001ip-6y@gemulon.postgresql.org> (raw)

Allow users to limit storage reserved by replication slots

Replication slots are useful to retain data that may be needed by a
replication system.  But experience has shown that allowing them to
retain excessive data can lead to the primary failing because of running
out of space.  This new feature allows the user to configure a maximum
amount of space to be reserved using the new option
max_slot_wal_keep_size.  Slots that overrun that space are invalidated
at checkpoint time, enabling the storage to be released.

Author: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/20170228.122736.123383594.horiguchi.kyotaro@lab.ntt.co.jp

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/catalogs.sgml                     |  38 +++++
doc/src/sgml/config.sgml                       |  23 +++
doc/src/sgml/high-availability.sgml            |   8 +-
src/backend/access/transam/xlog.c              | 145 ++++++++++++++---
src/backend/catalog/system_views.sql           |   4 +-
src/backend/replication/logical/logicalfuncs.c |   2 +-
src/backend/replication/slot.c                 | 100 +++++++++++-
src/backend/replication/slotfuncs.c            |  44 ++++-
src/backend/replication/walsender.c            |   4 +-
src/backend/utils/misc/guc.c                   |  13 ++
src/backend/utils/misc/postgresql.conf.sample  |   1 +
src/include/access/xlog.h                      |  14 ++
src/include/catalog/catversion.h               |   2 +-
src/include/catalog/pg_proc.dat                |   6 +-
src/include/replication/slot.h                 |  11 +-
src/test/recovery/t/019_replslot_limit.pl      | 217 +++++++++++++++++++++++++
src/test/regress/expected/rules.out            |   6 +-
17 files changed, 595 insertions(+), 43 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1jLwsJ-0001ip-6y@gemulon.postgresql.org>
Permalink:  ../E1jLwsJ-0001ip-6y@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jLwsJ-0001ip-6y@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: Allow users to limit storage reserved by replication slots
  In-Reply-To: <E1jLwsJ-0001ip-6y@gemulon.postgresql.org>
  References: <E1jLwsJ-0001ip-6y@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