diff options
author | Michael Paquier | 2025-02-26 05:26:16 +0000 |
---|---|---|
committer | Michael Paquier | 2025-02-26 05:26:16 +0000 |
commit | adc6032fa8824e7653252b02abc6a59d8b9d01a6 (patch) | |
tree | 135f52ac563ac09cdeb29d04f5e59757ad8efbe4 | |
parent | 6ee3b91bad269b8f1acee38607bd17923efd6e06 (diff) |
Improve FATAL message for invalid TLI history at recovery
The original message did not mention where the checkpoint record LSN was
found, a control file or a backup_label file. A couple of LOG messages
are generated before this FATAL check is reached, providing more details
about the way recovery is set up. However, knowing this information in
this specific message is useful for debugging. This is also useful for
instances where log_min_messages is set to FATAL or more, where LOG
messages do not show up.
Author: Benoit Lobréau <[email protected]>
Reviewed-by: David Steele <[email protected]>
Discussion: https://postgr.es/m/[email protected]
-rw-r--r-- | src/backend/access/transam/xlogrecovery.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlogrecovery.c b/src/backend/access/transam/xlogrecovery.c index c5475aaa97a..52f53fa12e0 100644 --- a/src/backend/access/transam/xlogrecovery.c +++ b/src/backend/access/transam/xlogrecovery.c @@ -849,7 +849,9 @@ InitWalRecovery(ControlFileData *ControlFile, bool *wasShutdown_ptr, ereport(FATAL, (errmsg("requested timeline %u is not a child of this server's history", recoveryTargetTLI), - errdetail("Latest checkpoint is at %X/%X on timeline %u, but in the history of the requested timeline, the server forked off from that timeline at %X/%X.", + /* translator: %s is a backup_label file or a pg_control file */ + errdetail("Latest checkpoint in file \"%s\" is at %X/%X on timeline %u, but in the history of the requested timeline, the server forked off from that timeline at %X/%X.", + haveBackupLabel ? "backup_label" : "pg_control", LSN_FORMAT_ARGS(CheckPointLoc), CheckPointTLI, LSN_FORMAT_ARGS(switchpoint)))); |