Re: Fix logging for invalid recovery timeline

David Steele <david@pgbackrest.org>

From: David Steele <david@pgbackrest.org>
To: Benoit Lobréau <benoit.lobreau@dalibo.com>, Michael Paquier <michael@paquier.xyz>
Cc: "Andrey M. Borodin" <x4mmm@yandex-team.ru>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2025-02-24T17:30:35Z
Lists: pgsql-hackers
On 2/24/25 10:21, Benoit Lobréau wrote:
> On 2/24/25 2:05 AM, Michael Paquier wrote:
>> I think that you have the right idea here, avoiding the duplication
>> of the errdetail() which feels itchy when looking at the patch. 
> 
> Done this way in the attached patch.

This looks good to me.

>> This should have a note for translators that this field refers to a file
>> name. 
> 
> Is there a specific way todo this?

If you search the source for translator: you'll find lots of examples. 
Here's one that was pretty relevant:

/* translator: %s is a configuration file */

We could probably phrase that as:

/* translator: %s is a backup_label or pg_control file */

That note goes right above the hint, so something like:

+                                /* translator: %s is a backup_label or 
pg_control file */
+				 errdetail("Latest checkpoint in %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",

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