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
signature.asc
Description: PGP signature