Re: pgsql: walreceiver uses a temporary replication slot by default

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Sergei Kornilov <sk(at)zsrv(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: pgsql: walreceiver uses a temporary replication slot by default
Date: 2020-01-22 05:55:10
Message-ID: 20200122055510.GH174860@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Hi Peter,
(Adding Andres and Sergei in CC.)

On Tue, Jan 14, 2020 at 01:57:34PM +0000, Peter Eisentraut wrote:
> walreceiver uses a temporary replication slot by default
>
> If no permanent replication slot is configured using
> primary_slot_name, the walreceiver now creates and uses a temporary
> replication slot. A new setting wal_receiver_create_temp_slot can be
> used to disable this behavior, for example, if the remote instance is
> out of replication slots.

A recent message from Seigei Kornilov has attracted my attention to
this commit:
https://www.postgresql.org/message-id/370331579618998@vla3-6a5326aeb4ee.qloud-c.yandex.net

In the thread about switching primary_conninfo to be reloadable, we
have argued at great lengths that we should never have the WAL
receiver fetch by itself the GUC parameters used for the connection
with its primary. Here is the main area of the discussion:
https://www.postgresql.org/message-id/20190217192720.qphwrraj66rht5lj@alap3.anarazel.de

The previous thread was long enough so it can easily be missed.
However, it seems to me that we may need to revisit a couple of things
for this commit? In short, the following things:
- wal_receiver_create_temp_slot should be made PGC_POSTMASTER,
similarly to primary_slot_name and primary_conninfo.
- WalReceiverMain() should not load the parameter from the GUC context
by itself.
- RequestXLogStreaming(), called by the startup process, should be in
charge of defining if a temp slot should be used or not.
--
Michael

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Sergei Kornilov 2020-01-22 15:58:46 Re: pgsql: walreceiver uses a temporary replication slot by default
Previous Message Fujii Masao 2020-01-22 02:57:42 pgsql: Add GUC ignore_invalid_pages.

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2020-01-22 06:06:52 Re: progress report for ANALYZE
Previous Message Amit Langote 2020-01-22 05:52:39 Re: progress report for ANALYZE