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 1rfXJc-000lc1-QW for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Feb 2024 03:42:38 +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 1rfXJb-00HGNY-CI for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Feb 2024 03:42:35 +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 1rfXJZ-00HGNQ-53 for pgsql-hackers@lists.postgresql.org; Thu, 29 Feb 2024 03:42:35 +0000 Received: from wfhigh1-smtp.messagingengine.com ([64.147.123.152]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rfXJV-0021Pl-05 for pgsql-hackers@postgresql.org; Thu, 29 Feb 2024 03:42:32 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.west.internal (Postfix) with ESMTP id 9EAED1800087; Wed, 28 Feb 2024 22:42:26 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 28 Feb 2024 22:42:26 -0500 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:subject :subject:to:to; s=fm1; t=1709178146; x=1709264546; bh=IspfxJC+RI xIGmzeBC2aHC/raTuC1qnwCfUmuTJJg0w=; b=XkLNXFUtUyQvzN2BJSZX6hvGnV 3tVymjKMrmm9rlvhQBgflGqjMdyiKyoKv5fyLWMCd4PIZljzBaip7ju5O2geIRaS qu3lCpgW+UyV04doV6yT0agS8s/w5VSSb+63rgF75wmPBLw/feD7VFz89wNM5jAl XK7XgBaAeK3b1NFCEtvodu5rEzlDW0Pab87kid/aLycm50qoypfdCB6leP4hZ0F7 2SqRDPZeT8DfsjFqVpI5cSX8yurROqgFKOin7kxyHvHp9k0FpOOgQ5z55JyOG+wJ +0LSSO+FJo1SWvm3ATUBlv5kcPCSsLYtO8B0PuBkwNXRNzn12/K3X1qThN2g== 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:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1709178146; x=1709264546; bh=IspfxJC+RIxIGmzeBC2aHC/raTuC 1qnwCfUmuTJJg0w=; b=FtSRZ7yOJtZNxmH9GUo5b5zsGqac9lFkuC8tJso2/Zfo LCtlgrXFtOoVnQeoolTBiORVAFd+Mk9yRBNq0tJ/vX9zLZdjjg7nbX8Pg+mcS+A3 +MSha3xFVC88uBywDDwpUMn55wNI77ecIFZyXkaZPks0DEitY8z6yDgWwoLXMaih 8Vzhh4M9GxS9U0tigYzxw3O0calWd5CHfdJ2kk8d/+0iORfKdV/K3VAfxIRLfz43 MVshVJ9bV2tMoR3jRFgA73gb4WFe5HkI/iJsRp4IlqeEYBQFi4QYvkUyXumjQo9u ciXU+SyQyZ9gSTM9g+qGP3f2I0RxoFBEhzT5PfIgMw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrgeekgdeitdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 28 Feb 2024 22:42:24 -0500 (EST) Date: Thu, 29 Feb 2024 12:42:13 +0900 From: Michael Paquier To: David Steele Cc: Pg Hackers Subject: Re: Add checkpoint/redo LSNs to recovery errors. Message-ID: References: <0e90da89-77ca-4ccf-872c-9626d755e288@pgmasters.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mqVVo1Cq1vWpYvxd" Content-Disposition: inline In-Reply-To: <0e90da89-77ca-4ccf-872c-9626d755e288@pgmasters.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --mqVVo1Cq1vWpYvxd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Feb 29, 2024 at 10:53:15AM +1300, David Steele wrote: > This patch adds checkpoint/redo LSNs to recovery error messages where they > may be useful for debugging. Thanks for following up on that! > When backup_label is not present, the checkpoint LSN is not logged unless > backup recovery is in progress or the checkpoint is found. In the case where > a backup is restored but the backup_label is missing, the checkpoint LSN is > not logged so it is useful for debugging to have it in the error message. ereport(PANIC, - (errmsg("could not locate a valid checkpoint record"))); + (errmsg("could not locate a valid checkpoint record at %X/%X", + LSN_FORMAT_ARGS(CheckPointLoc)))); } I've seen this one in the field occasionally, so that's really a welcome addition IMO. I've scanned a bit xlogrecovery.c, and I have spotted a couple of that could gain more information. ereport(PANIC, (errmsg("invalid redo record in shutdown checkpoint"))); [...] ereport(PANIC, (errmsg("invalid redo in checkpoint record"))); These two could mention CheckPointLoc and checkPoint.redo. ereport(PANIC, (errmsg("invalid next transaction ID"))); Perhaps some XID information could be added here? ereport(FATAL, (errmsg("WAL ends before consistent recovery point"))); [...] ereport(FATAL, (errmsg("WAL ends before end of online backup"), These two are in xlog.c, and don't mention backupStartPoint for the first one. Perhaps there's a point in adding some information about EndOfLog and LocalMinRecoveryPoint as well? -- Michael --mqVVo1Cq1vWpYvxd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmXf/RUACgkQnvQgOdby QH0amxAAmARNdqk0rNdMaZBcmPST5V0GSc9Ukji6FjraT9qz3t/a+CpnWUT0dnIY Wi06A91OCZ7vSVDcOckW84VF+eGNiJlCWKXve6w7OeUbq1Koa46ZHxH+fkgeMox6 Dgn4ISM5pzupppLvNn8p0Jfxo3+l+BMgadU+95H4Dg34AuSHix1z6l4JDWDNAYCY +cmHDzuM1+P7+8eob3Op7xNaP6DJtgYhkmt5Z90b0njmjVna13mGM7VW01IAL2Gh 8JQeuFqk0R6uAQBr4hhpWIPGOSxBFlGphJx9suTBDo7tfVc6TQ2BVOff66urPDXY tFzfMBUWuXeOsW/ySYGY3JqQuD17cPUVwA7XRV0CbONdLoqov8+8eco2zXc5rPmG 1qd8neKbj/WzJ54lWzEczNNcf9W7LCT165v093cAhpUCMqe0GRNtwW0/Mma4S6W3 4k79u5qTuetqPBP/4iX2bmjVzunMy/eM3FwnhULsUj5UR2nqUxPki+nS0y93RejJ RhVnHk0ZSElmym7x5J7grVWXRC+8PTOMUDTsEyqOeSTE641IfzCtO0zeCAHJJPf/ t8xdF9PNZUq3afqpnEP8vjzGE0ateJQ9el5Sa5FeH7Z8bGQL7g5mVavgFBMXLlAR zKWOIbfDxGskWkAhN39VeRWsIOucW+/32TyPZZA54dHUp1XeyIA= =5hD1 -----END PGP SIGNATURE----- --mqVVo1Cq1vWpYvxd--