Re: Implement waiting for wal lsn replay: reloaded
| От | Alexander Korotkov |
|---|---|
| Тема | Re: Implement waiting for wal lsn replay: reloaded |
| Дата | |
| Msg-id | CAPpHfduDVNo4VXgnQFZUg9=2yHQJfUUqjokbi3qVxuJiKNfcwg@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: Implement waiting for wal lsn replay: reloaded (Álvaro Herrera <alvherre@kurilemu.de>) |
| Список | pgsql-hackers |
On Thu, Jan 1, 2026 at 7:16 PM Álvaro Herrera <alvherre@kurilemu.de> wrote:
> In 0002 you have this kind of thing:
>
> > ereport(ERROR,
> > errcode(ERRCODE_QUERY_CANCELED),
> > - errmsg("timed out while waiting for target LSN %X/%08X to be
replayed;current replay LSN %X/%08X",
> > + errmsg("timed out while waiting for target LSN %X/%08X to be %s;
current%s LSN %X/%08X",
> > LSN_FORMAT_ARGS(lsn),
> > - LSN_FORMAT_ARGS(GetXLogReplayRecPtr(NULL))));
> > + desc->verb,
> > + desc->noun,
> > + LSN_FORMAT_ARGS(currentLSN)));
> > + }
>
>
> I'm afraid this technique doesn't work, for translatability reasons.
> Your whole design of having a struct with ->verb and ->noun is not
> workable (which is a pity, but you can't really fight this.) You need to
> spell out the whole messages for each case, something like
>
> if (lsntype == replay)
> ereport(ERROR,
> errcode(ERRCODE_QUERY_CANCELED),
> errmsg("timed out while waiting for target LSN %X/%08X to be replayed; current standby_replay LSN
%X/%08X",
> else if (lsntype == flush)
> ereport( ... )
>
> and so on. This means four separate messages for translation for each
> message your patch is adding, which is IMO the correct approach.
+1
Thank you for catching this, Alvaro. Yes, I think we need to get rid
of WaitLSNTypeDesc. It's nice idea, but we support too many languages
to have something like this.
------
Regards,
Alexander Korotkov
Supabase
В списке pgsql-hackers по дате отправления: