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 1qm0vF-005HGE-Kw for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Sep 2023 23:59:59 +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 1qm0vD-00HQnJ-Db for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Sep 2023 23:59:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qm0vB-00HQmo-Qp for pgsql-hackers@lists.postgresql.org; Thu, 28 Sep 2023 23:59:55 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qm0v7-008BDK-Ey for pgsql-hackers@lists.postgresql.org; Thu, 28 Sep 2023 23:59:53 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 533865C1FA0; Thu, 28 Sep 2023 19:59:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 28 Sep 2023 19:59:46 -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=fm2; t=1695945586; x=1696031986; bh=af uWsiG6hBozMZkpfOmCxJaf0l8Ni1TFG+rnWz+LBe8=; b=F1ofwJ7oabgyUC2DNx BsrEb+MCLnj7945VQH2KtC7WqsBzORAFRiD9/sZY7zg+7CU2HFG7nsdOIxXzygUF 29omvtbvR2G82ls8suCZhf+dCnc8GkxWSDyFjLLi5z6YW4Dw7eOt/MVdQ/uHMoOX yyhKH6MYTMpjmaUSG7W9mlYnuM9rxvOyVUkD7GWgxxNsUTYQ5uKMIQCccms2C611 RRqSo/WudsEHhrkN1O7MplujlCANmgqGFpSqiXnqKfTjJWBq0SHTjPIxUVQoHIBl /TIvM4D9kA3TbZ+A8Fy8FxSVNfNUIN577Ato6ZmOjDwSXfiv1eY9QSHYq5/wBYSj NV9g== 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=fm2; t=1695945586; x=1696031986; bh=afuWsiG6hBozM ZkpfOmCxJaf0l8Ni1TFG+rnWz+LBe8=; b=cCVuknR6SCPCubBsWGvOauklWQVkX I8cYc859alIOeH1FYTbThuJk16aJC/Wa3xEASN15Zcut21dLqgVVgBc/57pdMMm2 q0fXrKn5J4Ujuhelg7HBan3NTAVbCyAAOdnwmf2tcGBXmz89Gcni4LwgfLk0xBr8 SqVebv9xJREcjUyhkc+Q1SLmmy4kcE8AYrpzjkDXjUMjw2BN44w4aOG1WlpMmRd3 /mkVh6TjJbDM4/2zQSOhrp6nxK3SRdq6Y9it5NmNhzdOheQr1iyf048UMEARI0Ay qP39JgJyadkbQ5gFNblpWJt4sSS3WQCsFtsPuwVSHg3/yDfXv27U1tXUA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrtddugddvlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 28 Sep 2023 19:59:43 -0400 (EDT) Date: Fri, 29 Sep 2023 08:59:39 +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="EoSerEH9n2n70nEw" Content-Disposition: inline In-Reply-To: <4f94351c-24e2-cf32-82d3-1e1bf89a0f5e@pgmasters.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --EoSerEH9n2n70nEw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 28, 2023 at 04:23:42PM -0400, David Steele wrote: > After some playing around, I find I agree with Michael on this, i.e. requ= ire > at least standby.signal when a backup_label is present. >=20 > According to my testing, you can preserve the "independent server" > functionality by setting archive_command =3D /bin/false. In this case the > timeline is not advanced and recovery proceeds from whatever is available= in > pg_wal. I've seen folks depend on such setups in the past, actually, letting a process outside Postgres just "push" WAL segments to pg_wal instead of Postgres pulling it with a restore_command or a primary_conninfo for a standby. > I think this type of recovery from a backup label without a timeline chan= ge > should absolutely be the exception, not the default as it seems to be now. This can mess up archives pretty easily, additionally, so it's not something to encourage.. > If the server is truly independent, then the timeline change is not > important. If the server is not independent, then the timeline change is > critical. >=20 > So overall, +1 for Michael's patch, though I have only read through it and > not tested it yet. Reviews, thoughts and opinions are welcome. > One comment, though, if we are going to require recovery.signal when > backup_label is present, should it just be implied? Why error and force t= he > user to create it? That's one thing I was considering, but I also cannot convince myself that this is the best option because the presence of recovery.signal or standby.standby (if both, standby.signal takes priority) makes it clear what type of recovery is wanted at disk level. I'd be OK if folks think that this is a sensible consensus, as well, even if I don't really agree with it. 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. 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) -- Michael --EoSerEH9n2n70nEw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmUWE2sACgkQnvQgOdby QH2bGxAAhtuJzpS0aw36nJarzT0RHAOs/HhmnpNvun0ws10gSUyyRHlL+OyGwCzH C0bQiLE0qZTf1AmLmW8rpt07g2HmrxvFQBdfm66i29XXlOnAIukfhhOS3/noTfsq VVIFtWvArRrdRwENa/Flb2xJBO/zPzwOa7wyCvbxe9HnffCi5ULEIQ8Z63QCmg4g 5s7DGu/JdVMJkClNjCAJFIB2YJgz/b0aznZXKcExCOpHUzXY/umegPVAIU6jkfhw JSXPwGWQ//Sv+valsuC7d5qF5v+drnrOo/67qCnxsfSi2TtHjedkpz9DRY3ivO1U G1a9BxHr0nljqej4zWXJh+uLO56IceBd124itaT4vF7jTtggYT6TMn28A5KlAa9q HoMzorVz/GPzxUKWySawzIclX+vAd1QxTRV0rXBeO3l3cpbNAtXBLb4sMKGgtHk2 rI765w2MjE8Uf+Y/hdg2GUKF4eFaYF4RQscAMNxYeI1PsPr9t1CCYixTvv5M/QpA qocgmhgZr4WSUOmUMZeRG/PdrleUHU5W0hm9WOASys+U+cYuwawhgclPPzHrIyLx wl+hZtbJEodKLgxEUzZX0wm8tb6UIyN5VSj8Y5bLE6LVmOlcArK3RsMqjt2guecd TrzklYCuW/qESpIiDW/gHe+NWdHjy9rWp1BWWd0ltcXH49I1XkA= =zXOt -----END PGP SIGNATURE----- --EoSerEH9n2n70nEw--