From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Set wal_receiver_create_temp_slot PGC_POSTMASTER
Date: Fri, 27 Mar 2020 19:24:59 +0000
Message-ID: <E1jHubD-0001fM-98@gemulon.postgresql.org> (raw)
Set wal_receiver_create_temp_slot PGC_POSTMASTER
Commit 329730827848 gave walreceiver the ability to create and use a
temporary replication slot, and made it controllable by a GUC (enabled
by default) that can be changed with SIGHUP. That's useful but has two
problems: one, it's possible to cause the origin server to fill its disk
if the slot doesn't advance in time; and also there's a disconnect
between state passed down via the startup process and GUCs that
walreceiver reads directly.
We handle the first problem by setting the option to disabled by
default. If the user enables it, its on their head to make sure that
disk doesn't fill up.
We handle the second problem by passing the flag via startup rather than
having walreceiver acquire it directly, and making it PGC_POSTMASTER
(which ensures a walreceiver always has the fresh value). A future
commit can relax this (to PGC_SIGHUP again) by having the startup
process signal walreceiver to shutdown whenever the value changes.
Author: Sergei Kornilov <sk@zsrv.org>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/20200122055510.GH174860@paquier.xyz
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/092c6936de49effe63daad94855bcd8ef26a09dd
Modified Files
--------------
doc/src/sgml/config.sgml | 6 +--
src/backend/access/transam/xlog.c | 4 +-
src/backend/replication/walreceiver.c | 62 ++++++++++++---------------
src/backend/replication/walreceiverfuncs.c | 28 +++++++++---
src/backend/utils/misc/guc.c | 4 +-
src/backend/utils/misc/postgresql.conf.sample | 4 +-
src/include/access/xlog.h | 1 +
src/include/replication/walreceiver.h | 4 +-
8 files changed, 63 insertions(+), 50 deletions(-)
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: Set wal_receiver_create_temp_slot PGC_POSTMASTER
In-Reply-To: <E1jHubD-0001fM-98@gemulon.postgresql.org>
References: <E1jHubD-0001fM-98@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