public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: David Steele <[email protected]>
Cc: Pg Hackers <[email protected]>
Subject: Re: Add checkpoint/redo LSNs to recovery errors.
Date: Thu, 29 Feb 2024 12:42:13 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

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


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Add checkpoint/redo LSNs to recovery errors.
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox