Re: Add checkpoint/redo LSNs to recovery errors.

David Steele <david@pgmasters.net>

From: David Steele <david@pgmasters.net>
To: Michael Paquier <michael@paquier.xyz>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2024-03-10T03:58:19Z
Lists: pgsql-hackers
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



Commits

  1. Add some checkpoint and redo LSNs to a couple of recovery errors