Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3D1b-0003Y8-Ah for pgsql-hackers@arkaria.postgresql.org; Sun, 16 Feb 2020 06:03:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j3D1Y-0001Fs-9N for pgsql-hackers@arkaria.postgresql.org; Sun, 16 Feb 2020 06:03:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3D1Y-0001Fl-06 for pgsql-hackers@lists.postgresql.org; Sun, 16 Feb 2020 06:03:24 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j3D1W-00005X-Dv for pgsql-hackers@lists.postgresql.org; Sun, 16 Feb 2020 06:03:23 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7148F214CE; Sun, 16 Feb 2020 01:03:20 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 16 Feb 2020 01:03:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=mCkMCMZmI+E7dnXlxNT5013hDfe SPmmZQoyX4VD/UhE=; b=Jvdu2mNtDPyM1S0N8GjzfSWiewHg6e/I/2YMfQWzOqG FRBIyZT+69lRDQorwSUtQyz+YgFMZFe/yRaG95qMNZBkPDBSqKCa0fwQTEMC01aB NlEBejtbTYZLrkkJQElCW/8GvYpbTch2t1YWKjEplzAfPxYGTajZCZTY5+9G32OJ JPUkoXIkEi9S1L2mNmMjruwqMxz8FJl7fNofLBErlqf6NdHa84PrbLrGTpn5+/xI Z4T8ABsb4KaIK/4qELgtka5dERYaw0iexdhsCjvKTKSc911x0ko3QkH2u84p/gRC n9BXPq1OEtqt9Fx22m8bB4WOpozGSNIeokLVjckbw7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=mCkMCM ZmI+E7dnXlxNT5013hDfeSPmmZQoyX4VD/UhE=; b=tqtrOgPx/vLucMoVLyRppW gE+QTPpNBfql/gbihraAQTug1xQqcAr10lo059ujcDSrjx8SGrnD/RPfLKgny60O 0zOKq/aKiDckzAL0xbVDjKshRnTcsw52nTLQs2tObcnMIdTK6nyrbEOoXtA9DlAJ IFU4/mjRmdwEJjOjomK5EIu0olqlW/3975sPEoz8TO69L8rl//sCr7Ro3LFMCYZr DcdsY8j7aA18ZMnxFSJ02xgdDByp98Aa375fUwyR52GyBUWn90Hxbf2D9iW7KTkr bM0uh3bcEmUHH4GGo8eue0L3u6KGl6lKcvtDFry6xvnpjGIfmSlUEP0xVnHEHLPw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjeefgdelfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecukfhppeduuddurddutddvrddukedtrddukeehnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesph grqhhuihgvrhdrgiihii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 5CE41328005A; Sun, 16 Feb 2020 01:03:18 -0500 (EST) Date: Sun, 16 Feb 2020 15:03:14 +0900 From: Michael Paquier To: Sergei Kornilov Cc: Peter Eisentraut , Postgres hackers , Andres Freund Subject: Re: pgsql: walreceiver uses a temporary replication slot by default Message-ID: <20200216060314.GC97911@paquier.xyz> References: <20200122055510.GH174860@paquier.xyz> <753391579708726@iva3-77ae5995f07f.qloud-c.yandex.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QRj9sO5tAVLaXnSD" Content-Disposition: inline In-Reply-To: <753391579708726@iva3-77ae5995f07f.qloud-c.yandex.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --QRj9sO5tAVLaXnSD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 i= n "allow online change primary_conninfo" thread. > This thread is more appropriate for discussion about wal_receiver_create_= temp_slot. >=20 > 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 --QRj9sO5tAVLaXnSD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl5I2yIACgkQnvQgOdby QH2CcA/+MrhN7+xkIhinZR/mINo34HdVBUFjxRiHom0qj5RMsLTngU7WvWg57/QN xjuuwRqW0H2yCTQWEbFmaYVAAJKV2bxliX7RWOXaujwQHQOnSc5e4u3vjlWNci5Z sLADMywYvEyyWkevknAxmbXa+nN29zaFVLNvpCeS5NRRO2OXUnfH5VWUQXiI53L7 Ycqbd/meuDHs7Nw7iTap6Ep3RP/ylPAVRxT9Ht38w72kd7xwCIJ6IAFmpjmEbGet apu4pH2C+MbkF5ccLPgEF9QKmvK7zKL3TzN4wF/LJ3f6C5YtuF/NqheVTAGxhdft /TgpY6MHD+fqwxLiOtDxub5nOIe3KPnGPgCoJi6w/5xUuTy6eUaiIznZoTwTEyvj baE/G1XN14CQ/+kWyU6kK+Dz6hzQXtxWGCq49X/fS7KmR3JH4g7IsUxYoJkP+Rl4 pd6inxZw3NFleJbISyMPAFitvjc2vzZ5rdaGvJdMhu5rq2WP8GF3ddJ9QRs9Oewd XF9/h8S50eU0e0O/4m37M7/QfUxvlJj6z08oC78bh3z7QEeDt6S9onui3rpmCOFf ghwNmYIREvGZq8RxsqdCehMbkqIdK03ZhRYhuTRb6BKN3yrL/CPKz7oEQjNuNS8B F1pHWNSa6AjFR6+QLVlEq6VaKMs4s2fStyJlzvw9WJ3VBoh7aPk= =5XIa -----END PGP SIGNATURE----- --QRj9sO5tAVLaXnSD--