Re: Fix logging for invalid recovery timeline

From: David Steele <david(at)pgbackrest(dot)org>
To: Benoit Lobréau <benoit(dot)lobreau(at)dalibo(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix logging for invalid recovery timeline
Date: 2025-02-24 17:30:35
Message-ID: 26fd4e28-8b75-4e61-a3fd-aed3b7442606@pgbackrest.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2025-02-24 17:39:52 Re: [PoC] Federated Authn/z with OAUTHBEARER
Previous Message Robert Haas 2025-02-24 17:24:01 Re: Make query cancellation keys longer