Fix logging for invalid recovery timeline

David Steele <david@pgbackrest.org>

From: David Steele <david@pgbackrest.org>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2024-12-20T15:37:36Z
Lists: pgsql-hackers

Attachments

Hackers,

I noticed while debugging a user issue that the checkpoint logged in

"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."

is being pulled from the value stored in the control file rather than 
the value read from backup_label (in the case where there is a 
backup_label). This only affects logging since the timeline check is 
done against the checkpoint/TLI as read from backup_label.

This patch updates the checkpoint and TLI to (what I believe are) the 
correct values for logging.

I think this should also be back-patched.

Regards,
-David

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Improve FATAL message for invalid TLI history at recovery

  2. Fix FATAL message for invalid recovery timeline at beginning of recovery