pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Sergei Kornilov <sk@zsrv.org>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Cc: Andres Freund <andres@anarazel.de>
Subject: Re: pgsql: walreceiver uses a temporary replication slot by default
Date: Sun, 16 Feb 2020 15:03:14 +0900
Message-ID: <20200216060314.GC97911@paquier.xyz> (raw)
In-Reply-To: <753391579708726@iva3-77ae5995f07f.qloud-c.yandex.net>
References: <E1irMhK-00021w-9z@gemulon.postgresql.org>
	<20200122055510.GH174860@paquier.xyz>
	<753391579708726@iva3-77ae5995f07f.qloud-c.yandex.net>

On Wed, Jan 22, 2020 at 06:58:46PM +0300, Sergei Kornilov wrote:
> I would like to cross-post here a patch with such changes that I posted in "allow online change primary_conninfo" thread.
> This thread is more appropriate for discussion about wal_receiver_create_temp_slot.
> 
> PS: I posted this patch in both threads mostly to make cfbot happy.

Thanks for posting this patch, Sergei.  Here is a review to make
things move on.

-    * Create temporary replication slot if no slot name is configured or
-    * the slot from the previous run was temporary, unless
-    * wal_receiver_create_temp_slot is disabled.  We also need to handle
-    * the case where the previous run used a temporary slot but
-    * wal_receiver_create_temp_slot was changed in the meantime.  In that
-    * case, we delete the old slot name in shared memory.  (This would
+    * Create temporary replication slot if requested.  In that
+    * case, we update slot name in shared memory. (This would

The set of comments you are removing from walreceiver.c to decide if a
temporary slot needs to be created or not should be moved to
walreceiverfuncs.c as you move the logic from the WAL receiver startup
phase to the moment the WAL receiver spawn is requested.

I agree with the simplifications in WalReceiverMain() as you have
switched wal_receiver_create_temp_slot to be PGC_POSTMASTER, so
modifications are no longer a state that matter.

It would be more consistent with primary_conn_info and
primary_slot_name if wal_receiver_create_temp_slot is passed down as
an argument of RequestXLogStreaming().

As per the discussion done on this thread, let's also switch the
parameter default to be disabled.  Peter, as the committer of 3297308,
it would be good if you could chime in.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (17+ messages)  latest in thread

Message-ID: <20200216060314.GC97911@paquier.xyz>
Permalink:  ../20200216060314.GC97911@paquier.xyz/
Also on:    postgresql.org/message-id/20200216060314.GC97911@paquier.xyz

 · 

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: michael@paquier.xyz, sk@zsrv.org, peter@eisentraut.org, pgsql-hackers@lists.postgresql.org, andres@anarazel.de
  Subject: Re: pgsql: walreceiver uses a temporary replication slot by default
  In-Reply-To: <20200216060314.GC97911@paquier.xyz>
  References: <E1irMhK-00021w-9z@gemulon.postgresql.org> <20200122055510.GH174860@paquier.xyz> <753391579708726@iva3-77ae5995f07f.qloud-c.yandex.net> <20200216060314.GC97911@paquier.xyz>

* 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