Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mI47E-0004SO-3y for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Aug 2021 07:11:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mI47C-0006dS-QK for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Aug 2021 07:11:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mI47C-0006dK-JK for pgsql-bugs@lists.postgresql.org; Mon, 23 Aug 2021 07:11:26 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mI477-0002j4-JI for pgsql-bugs@lists.postgresql.org; Mon, 23 Aug 2021 07:11:25 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id F2F465C00A5; Mon, 23 Aug 2021 03:11:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 23 Aug 2021 03:11:19 -0400 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=fm2; bh=uNsH6hBy/yqpi14KEfOnmlygs0w +m+KxGYotuzBxqxk=; b=BKUmCM43/V4BUatQWhnoaDqJkhAlcaYksxeXY3zhYpe 7pZiz6V9zPXc3ACvT4hVqq4ovjEbUx9Fdavb6hT1qpBmgMxzzcDi4kLSftsOj4+e W6K2FVzr/2kjE1LMYT+GI5IGTSe7Xl1slbOiqm/vXhMjD8tIfFrSPbGDifptj29T rrKo6WZk86j74R2yB2OSn8kSYNY+9+wQ1GdRyPpZqsAYXgfPRoP95K67Rq0cUCnW jYIGTYNsELF1KiNhIcZY061aNVVZ8DwGfvzfRmJbaFQRDz6Mp1sTOAWOYnjKcD+T JUtLtUTlt/me2iSLZTQOrFel19Kplmp9o0m6hwIGTIQ== 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=fm3; bh=uNsH6h By/yqpi14KEfOnmlygs0w+m+KxGYotuzBxqxk=; b=esjCKn5BiWOC0HaQQfsH9A v1zGpkE6oLoGzOOraMcnLQC/DBS3B6y3dvJEnPx9eFAyonBTrvieyClu6Q8NApJL qTa7KCGBKZbMFc97c8Zlp6zpAwtrLVt3/zYb+m750i1SttXHRXiOfJuyav8++HoY AE2Vw9vAu6yT83ks8RWpZat5CwtQMBES34bXztHsO/hBvQFSkH4/38x1SvRRgcoZ DgjEYDGU6Ra8eX6PjSF0IHNRAo/mvQSZ81iTNWEVvrXo1twIUGU/16RiMR2+qd0O XUilGXLX4iNVa8UCxtx7V4+p9KdNsLdM4fR1ywl9+FdmVcRXTtNpeWYDVv46cYOw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddtgedgudduiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculddvfedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredt tdejnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepudekvdelieejgfejheelfffh vddtudegleehuefhkeffgeehhedvtdefffeuhfeknecuffhomhgrihhnpehpohhsthhgrh gvshhprhhordgtohhmpdhpohhsthhgrhgvshhqlhdrohhrghenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivg hrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 23 Aug 2021 03:11:17 -0400 (EDT) Date: Mon, 23 Aug 2021 16:11:12 +0900 From: Michael Paquier To: Masahiko Sawada Cc: "Gerard H. Pille" , PostgreSQL mailing lists Subject: Re: pg_basebackup behavior on non-existent slot Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VyGH4R2bdMjv7JIS" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --VyGH4R2bdMjv7JIS Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 23, 2021 at 12:54:58PM +0900, Masahiko Sawada wrote: > On Sat, Aug 21, 2021 at 10:15 PM Gerard H. Pille wr= ote: >> The old thread: >> https://postgrespro.com/list/thread-id/2337189#CAMkU=3D1wSxYBNFY9TzuVh3= =3DmDLr4BBsMct6wcViNMH+-6Xon4Uw@mail.gmail.com A link to postgresql.org does the same work: https://www.postgresql.org/message-id/CAMkU=3D1wSxYBNFY9TzuVh3=3DmDLr4BBsMc= t6wcViNMH+-6Xon4Uw@mail.gmail.com No need to redirect that elsewhere. > It seems it's not fixed yet even in HEAD as far as I tested. There > were some ideas to fix that on that thread but the main point was how > to fix it on Windows. I guess that since it creates a transient slot > it=E2=80=99s not a common case to specify a non-existence slot in pg_base= back > but what is your use case? This might help motivate to fix this issue. >=20 > BTW in that thread, there was a discussion on how to detect the > streamer process failure in the main process but probably we can fix > this by just doing an existence check for the specified name > replication slot before starting the streamer process? Yeah. Honestly, I am not really excited to redesign this part of base backups just to take care of a side problem that is mitigated for most=20 users with the use of a temporary slot. It would be simpler, as you say, to find a way to detect if the slot wanted exists before even launching START_REPLICATION with the specified slot on the second thread copying the WAL, but that would be a new thing as one cannot do catalog lookups with a physical replication session. Some ideas here may be to extend the result of IDENTIFY_SYSTEM to return the slots available in a text array, invent a new command called SLOT, use SHOW or perhaps do an extra CREATE_REPLICATION_SLOT TEMPORARY from the main thread. -- Michael --VyGH4R2bdMjv7JIS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmEjShAACgkQnvQgOdby QH3cHA/+KXO8rEJYKbtjfw30naNUT1bfyPgnGaVCoWP36fzHsNMVRezZGSJjVXS8 WtaLxgipqYH2PG9rhaCXEXYKExRoOoTxW4p2gpPS7MHLZhH0/l8EjafEN0GJsphu 3QuRs7SrrIhACTyRDZpeNPj6sBLBeC65wMlAsUlsnh5nALRguECd5Ih6IkhiX5Tn /EJIsOKD8WlwFiVhii0b00Dm3PyZju4XXQSj/Y+Vpf3Q5HSnGYF2LPLR5LpB4I1j lveQ4DQPA0B/KB9WLbFLcmuS0nYOqB9Rs4Wy3zWD8jbGsjgb7BiWsfg2Qm+UyLkl 2YQbjtYfjWJzzrYBrbnDs71M7kSAzszbtb1y9RmSv/i9bp+BRtAFC5Cj8TqUg8+x Ml38j3yMjtAq9OsKAkSADMp3+/sBYCvjoc2xyQHMk76TrVdfRBPpZXL0/C7L+fPL j9yCIpHf9pCJXwWJuxaUWM29jZZT65ZWBbMQALK8RYm23a7Usw4EUOmFchv5eHj3 Fkdr3OZx+RW60llaZY6fFpB/QsH5+nR9GMOxLL/1uhJBYgar91SOuit6omP+tDOW ICH61oiqtzpun/dZHNpCiuKBCIUKilfqg8jCE8sFS/9EBMyTxwb58Tmiwq3WTle/ W3ZcQ5R3DvWVsTy2KdcC2jwA6uRwTV8LlX1jxW0u+fF3Qc1hYn4= =Lpx+ -----END PGP SIGNATURE----- --VyGH4R2bdMjv7JIS--