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: Adjust max_slot_wal_keep_size behavior per review
Date: Wed, 24 Jun 2020 18:24:51 +0000
Message-ID: <E1joA4p-0007ND-9L@gemulon.postgresql.org> (raw)

Adjust max_slot_wal_keep_size behavior per review

In pg_replication_slot, change output from normal/reserved/lost to
reserved/extended/unreserved/ lost, which better expresses the possible
states particularly near the time where segments are no longer safe but
checkpoint has not run yet.

Under the new definition, reserved means the slot is consuming WAL
that's still under the normal WAL size constraints; extended means it's
consuming WAL that's being protected by wal_keep_segments or the slot
itself, whose size is below max_slot_wal_keep_size; unreserved means the
WAL is no longer safe, but checkpoint has not yet removed those files.
Such as slot is in imminent danger, but can still continue for a little
while and may catch up to the reserved WAL space.

Also, there were some bugs in the calculations used to report the
status; fixed those.

Backpatch to 13.

Reported-by: Fujii Masao <masao.fujii@oss.nttdata.com>
Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@oss.nttdata.com>
Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/20200616.120236.1809496990963386593.horikyota.ntt@gmail.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/catalogs.sgml                | 24 +++++++++----
src/backend/access/transam/xlog.c         | 57 +++++++++++++++++--------------
src/backend/replication/slotfuncs.c       | 39 ++++++++++++++++-----
src/include/access/xlog.h                 |  6 ++--
src/test/recovery/t/019_replslot_limit.pl | 23 +++++++------
5 files changed, 96 insertions(+), 53 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1joA4p-0007ND-9L@gemulon.postgresql.org>
Permalink:  ../E1joA4p-0007ND-9L@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1joA4p-0007ND-9L@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: Adjust max_slot_wal_keep_size behavior per review
  In-Reply-To: <E1joA4p-0007ND-9L@gemulon.postgresql.org>
  References: <E1joA4p-0007ND-9L@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