Re: Add checkpoint/redo LSNs to recovery errors.

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Add checkpoint/redo LSNs to recovery errors.
Дата
Msg-id Zd_9Fa4epaTc9rXS@paquier.xyz
обсуждение исходный текст
Ответ на Add checkpoint/redo LSNs to recovery errors.  (David Steele <david@pgmasters.net>)
Ответы Re: Add checkpoint/redo LSNs to recovery errors.  (David Steele <david@pgmasters.net>)
Список pgsql-hackers
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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Zhijie Hou (Fujitsu)"
Дата:
Сообщение: RE: Synchronizing slots from primary to standby
Следующее
От: Peter Smith
Дата:
Сообщение: Re: Synchronizing slots from primary to standby