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 1qsXAh-008Ofm-F0 for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Oct 2023 23:38:51 +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 1qsXAf-005A7T-7j for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Oct 2023 23:38:49 +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 1qsXAe-005A7L-UR for pgsql-hackers@lists.postgresql.org; Mon, 16 Oct 2023 23:38:49 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qsXAc-000pMr-Vi for pgsql-hackers@postgresql.org; Mon, 16 Oct 2023 23:38:48 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 1404B5C0464; Mon, 16 Oct 2023 19:38:46 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 16 Oct 2023 19:38: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=fm3; t=1697499526; x=1697585926; bh=xh rAyQVf9pOGnm5i0gYCrgLZL+gFCAncT3FjAoR++q8=; b=oBJG2x1JwVggU2dV28 mslpwrsomk1yZBgIMAOJDZqyAJxNiCki4lXFc/NOovrqojb3veof0JXtuOGAHR1U DUFE4Zl9LYYzaCBY0+ZeNTO85K/T/DTMxehosHPphCzT6I0x5wOq5XX/gIBlhHUI 0ZFXgbmIeTI6QLd8eNfyhEIX46o0d81Imx8Or8MkDQ0JVwgwScTw0LiZdSD7t7T6 amJtjSSQq1oIWRQ8s/hJMDYBslEz8RL+kT0vYh/JZfNf+O/Vp/6nGRDedHXMyPks lmGZWrAjZVcp0XMz/XaDsbFMeoH2XrZV+Qi9SH+bUAvEqF6gBDZ5wn52Umzrk0JQ IqKg== 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=1697499526; x=1697585926; bh=xhrAyQVf9pOGn m5i0gYCrgLZL+gFCAncT3FjAoR++q8=; b=KtAKa6LDLCqBVo8fhKXOhPZcBuaCR LcqjJJLr4mvnxJTRA3MZQCVsH6SPaV9FN8wDbCTAzAWs+4l5i1/hKA7MxM9nDNcw T8u7XkR6Jbhhyx8eMFWu+vO/cJs0OYJaNeYwtrGsw21ko+41szr3TpPq3MugVi07 o4JSVL0jSzD1a4F3FQ1flC4FZWBXC/IphvA9OJdJp5Mjf65akZVx0Hg8e81GIxDI /hVG0G6ai4GVl9DxFEbj30fwD5jeJBg6vEeqStYReNriD51JBkU57ZdwSHHWHHTw qDLeWDK0647IoN5ada4Iu5IGokiWPiZ7kWNqfE8P2WtYXDYRoYPj7kWUQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjedugddvgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdefhedmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt jeenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeevteejgfejveegudekheeiueei ueeiveeuiedugeehveeugffgudeuleegleeiteenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 Oct 2023 19:38:43 -0400 (EDT) Date: Tue, 17 Oct 2023 08:38:40 +0900 From: Michael Paquier To: Robert Haas Cc: David Steele , Thomas Munro , Pg Hackers , Stephen Frost Subject: Re: The danger of deleting backup_label Message-ID: References: <1330cb48-4e47-03ca-f2fb-b144b49514d8@pgmasters.net> <0e088834-aa39-ed09-3ec7-31c13c629a20@pgmasters.net> <65825be1-e79a-46f4-9d9f-4ff95a10e378@pgmasters.net> <9dc67363-5200-7395-3ddb-b50171800bc6@pgmasters.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2R7igAGiwXkS6GXj" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --2R7igAGiwXkS6GXj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 16, 2023 at 12:25:59PM -0400, Robert Haas wrote: > On Mon, Oct 16, 2023 at 11:45=E2=80=AFAM David Steele wrote: > > If you start from the last checkpoint (which is what will generally be > > stored in pg_control) then the effect is pretty similar. >=20 > If the backup didn't span a checkpoint, then restoring from the one in > pg_control actually works fine. Not that I'm encouraging that. But if > you replay WAL from the control file, you at least get the last > checkpoint's worth of WAL; if you use pg_resetwal, you get nothing. There's no guarantee that the backend didn't spawn an extra checkpoint while a base backup was taken, either, because we don't fail hard at the end of the BASE_BACKUP code paths if the redo LSN has been updated since the beginning of a BASE_BACKUP. So that's really *never* do it except if you like silent corruptions. > I don't really want to get hung up on this though. My main point here > is that I have trouble believing that an error after you've already > screwed up your backup helps much. I think what we need is to make it > less likely that you will screw up your backup in the first place. Yeah.. Now what's the best user experience? Is it better for a base backup to fail and have a user retry? Or is it better to have the backend-side backup logic do what we think is safer? The former (likely with a REDO check or similar), will likely never work on large instances, while users will likely always find ways to screw up base backups taken by latter methods. A third approach is to put more careful checks at restore time, and the latter helps a lot here. -- Michael --2R7igAGiwXkS6GXj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmUtyYAACgkQnvQgOdby QH0GLw/+Llgw1nSFDG/fPAe7imMVM4hK+NJfBMfTt+VKx+k5T0Z0ktJOyIHJuVPh /cvvkN8CPSBfKRj3yN8OhwQXqrCp56rDWc+H8xzMAe2WmZsWblUmWJTILIlowJrw hBZiOKwgwNsN6c88ZHkPG3zTRRbyem3syM2wwk7UBBPeoR961F9Zx2RmyuWfVLaU eqNs3zFvs2PW8fm4BXQVSoMjGcD+PuI+ztCnEGYojyUym1K4xguq8xA06JcpVSbN mFUqYQRBtNZyaXWk8JZ3NfvJwE7nw+/s90GzcYqA3E12QHiZnDr1jbhjVQBQyplJ kseOGvVgxUI56yqsbuyobRv5U9TaGm1wAHeIiu/vzmO1KcfrP1qt7icAqF0BfIC+ VlMD1tiVIFH5MxbcwPcpymXOYZHoQ0kVO19+GfvVwp7l1v8wWOiw81ZiqjmO4vKh RdLZn1Tf6Wr6yhcO8kEKY/uXsri9pyi8mp8eeebl6TKA/KUciTmZlzVhNBs9o9hk lAgNaCddqEL0yD9I6PqVG7mB+FJ3p6UFFYJ3HLDN8DCwyfrv0KjLIOJxMH4uug8f zH79XzkrHJg9zUyh2w/npWVCtWQJTDSmWqgCmFYh1vyBPy/3QLNdRxGY7IaNidt2 VP5jaJ2+EwTJ3PySZIfyQDnLM0FrC0Rl+ECZ1h3Dk5rRxrGp2uw= =eBBG -----END PGP SIGNATURE----- --2R7igAGiwXkS6GXj--