Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qsGYz-007MAp-AN for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Oct 2023 05:54:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qsGYx-00G2Ta-4w for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Oct 2023 05:54:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qsGYv-00G2RC-K6 for pgsql-hackers@lists.postgresql.org; Mon, 16 Oct 2023 05:54:47 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qsGYt-000hkp-06 for pgsql-hackers@lists.postgresql.org; Mon, 16 Oct 2023 05:54:45 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id DEDAC5C0235; Mon, 16 Oct 2023 01:54:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 16 Oct 2023 01:54:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1697435680; x=1697522080; bh=x4 IF9mXqIkN95ur3695/MMF86daweYnyL57PZY/dnrQ=; b=WArohiU5/LkLlhJ1Iy 0Z/KOlsUdi2sh099scJ+EfVKk2WK8ybgQ1veiwfctrDVWYB7Y0axLuxZR37z0KlM Z5e0QBXRhc8Yz1iDAjUkhg3/NkYLCi0fcnNZMBnEFYDVxBMJV4NA/FrUoWg9G/Hb g51+y3FWIuroV/MJMiN6S8WYAA6sQQMF6XnJnWHnKi7wYgNT3yhNIrpJgD92zv7d +/LI3YE4TelBVjeK22k5ThPonQ9FgvZvNyee9A3mPITgQWg9TktMRoOn2e3btsBZ hmxnzBSECoTn9HZogaxexDR+dICjJMnG5zGQWe1mdl0Ilr3xVVOLeKcnU9hnaZOG WGuw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1697435680; x=1697522080; bh=x4IF9mXqIkN95 ur3695/MMF86daweYnyL57PZY/dnrQ=; b=h7iuCqQE4iHRpa+MnWH+h1oHmMW6d HkUF+xZMpmBZuuSsGjS2jivlKhy3clksIVv0GGPZMJt7hmUaVSU/GZ/ZODjf8jSj vFv50Suky3dD/87Mvaqfw2hCh5XBxYeU3eCyuQE6wklL+dQmuREwAX/yc22kdSqh lbosSBGvHz2Pr/hmbIpdm4IxBID6o4m1WQaDm/3EFQEWHLpyHwmyVDibg54SXvaA K7kPwxtpFVDIoohD8PHj9xTeN4a5QV03x97cOikQ6vH9lpo6L9c8vXhBbxgwC0Fj NI88FJbhFEXS6l15LpXtPIQtdAVB40K7GEfhzDRMnY2LIbNk9uEo/D9mQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrieelgdellecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 Oct 2023 01:54:38 -0400 (EDT) Date: Mon, 16 Oct 2023 14:54:35 +0900 From: Michael Paquier To: David Steele Cc: Kyotaro Horiguchi , pgsql-hackers@lists.postgresql.org, zxwsbg12138@gmail.com, david.zhang@highgo.ca Subject: Re: Requiring recovery.signal or standby.signal when recovering with a backup_label Message-ID: References: <20230928.125851.2051261991058034791.horikyota.ntt@gmail.com> <4f94351c-24e2-cf32-82d3-1e1bf89a0f5e@pgmasters.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2x2s7IhQdRv6lQ2H" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --2x2s7IhQdRv6lQ2H Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 14, 2023 at 03:45:33PM -0400, David Steele wrote: > On 9/28/23 19:59, Michael Paquier wrote: > OK, I have now reviewed and tested the patch and it looks good to me. I > stopped short of marking this RfC since there are other reviewers in the > mix. Thanks for the review. Yes, I am wondering if other people would chime in here. It doesn't feel like this has gathered enough opinions. Now this thread has been around for many months, and we've done quite a few changes in the backup APIs in the last few years with few users complaining back about them.. > I dislike that we need to repeat: >=20 > OwnLatch(&XLogRecoveryCtl->recoveryWakeupLatch); >=20 > But I see the logic behind why you did it and there's no better way to do= it > as far as I can see. The main point is that there is no meaning in setting the latch until the backup_label file is read because if ArchiveRecoveryRequested is *not* set the startup process would outright fail as of the lack of [recovery|standby].signal. >> Another idea I had was to force the creation of recovery.signal by >> pg_basebackup even if -R is not used. All the reports we've seen with >> people getting confused came from pg_basebackup that enforces no >> configuration. >=20 > This change makes it more obvious if configuration is missing (since you'= ll > get an error), however +1 for adding this to pg_basebackup. Looking at the streaming APIs of pg_basebackup, it looks like this would be a matter of using bbstreamer_inject_file() to inject an empty file into the stream. Still something seems to be off once compression methods are involved.. Hmm. I am not sure. Well, this could always be done as a patch independant of this one, under a separate discussion. There are extra arguments about whether it would be a good idea to add a recovery.signal even when taking a backup from a standby, and do that only in 17~. >> A last thing, that had better be covered in a separate thread and >> patch, is about validateRecoveryParameters(). These days, I'd like to >> think that it may be OK to lift at least the restriction on >> restore_command being required if we are doing recovery to ease the >> case of self-contained backups (aka the case where all the WAL needed >> to reach a consistent point is in pg_wal/ or its tarball) >=20 > Hmmm, I'm not sure about this. I'd prefer users set > restore_command=3D/bin/false explicitly to fetch WAL from pg_wal by defau= lt if > that's what they really intend. It wouldn't be the first time we break compatibility in this area, so perhaps you are right and keeping this requirement is fine, even if it requires one extra step when recovering a self-contained backup generated by pg_basebackup. At least this forces users to look at their setup and check if something is wrong. We'd likely finish with a few "bug" reports, as well :D -- Michael --2x2s7IhQdRv6lQ2H Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmUs0BsACgkQnvQgOdby QH1fjQ//YSwlwVzGkH32vEg3+u0PC5mrBPcdRPmKSCAihkOBTyy3hclWIqtHi3sC WHAxZgi/zlpOH6mOk7M41MOwoyrFgmgl8cv1I8psgGH4+S4VKgAD57RSFEzkdWBg gt+rOTEUaw+jcbcUiLDJOIlGWaf+iN3Vy+rIChFxEHTVspKlXStnbVUajFw5Z84E ibA/cFA9dvuSNfIpP4B3r8cUNC4ooxM8H2moisxk+2biopzHwbkKGLbIMlvbcQH/ 9TQsfTH9ojJjkEBp/y49UPg2MIWGHaiQ2saKHrigbPXdFMOOzxuEyAGddBoZXAlb o7eXbMMqzum5v4s2iCZeT25jrZgJgfPshwP9lpc0Dvi551/cdeQFEHz/61ic1IUj VLW+gNhq/Zk+0URybVKJ+VOWrCzhiybVyFlpV8hMqh3s7mfR7TjbShSJI7X21vT7 apbe5ybNvjzV/psIPlRNhl+PTdUiDVhVCjqER1evjaHl2rLxUuF82OBUssomqSWm exw/Azd12WUGzrxPltUV/JP/jTW6Z9Q+tsyECA3mTNNxd+0bhDNg40ZvfxAdM4Kk f9HUXHR6//SCyBquHjXueAfgRctk4MZQEmx7pS4Ul6FuBpb7g2ZRPFUqclVH5Xsc 1l8xWK8Bs3GHoGzsaXCBOB1MgkuqLeewaHDCOpy1tctv5wANcvs= =mt8O -----END PGP SIGNATURE----- --2x2s7IhQdRv6lQ2H--