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 1rjAKU-003sDk-SB for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Mar 2024 03:58:31 +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 1rjAKS-002t4E-P0 for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Mar 2024 03:58:29 +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 1rjAKS-002t46-Fp for pgsql-hackers@lists.postgresql.org; Sun, 10 Mar 2024 03:58:28 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rjAKQ-003htH-CT for pgsql-hackers@postgresql.org; Sun, 10 Mar 2024 03:58:28 +0000 Received: from [10.5.0.2] (unknown [64.44.118.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id 12D48548BF; Sun, 10 Mar 2024 03:58:23 +0000 (UTC) Message-ID: <882d1d78-f17a-4f70-a758-2750c49b71f6@pgmasters.net> Date: Sun, 10 Mar 2024 16:58:19 +1300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Add checkpoint/redo LSNs to recovery errors. Content-Language: en-US To: Michael Paquier Cc: Pg Hackers References: <0e90da89-77ca-4ccf-872c-9626d755e288@pgmasters.net> From: David Steele In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/29/24 16:42, Michael Paquier wrote: > 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. > > 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? For now I'd like to just focus on these three messages that are related to a missing backup_label or a misconfiguration of restore_command when backup_label is present. No doubt there are many other recovery log messages that could be improved, but I'd rather not bog down the patch. Regards, -David