public inbox for [email protected]
help / color / mirror / Atom feedFrom: Xuneng Zhou <[email protected]>
To: Alexander Korotkov <[email protected]>
Cc: Álvaro Herrera <[email protected]>
Cc: Chao Li <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: Michael Paquier <[email protected]>
Cc: jian he <[email protected]>
Cc: Tomas Vondra <[email protected]>
Cc: Yura Sokolov <[email protected]>
Subject: Re: Implement waiting for wal lsn replay: reloaded
Date: Sun, 4 Jan 2026 00:10:44 +0800
Message-ID: <CABPTF7Vy4A0S0W7=B-fVd9Bo_15XG_FRYfKUF2CB_i=5svwEZQ@mail.gmail.com> (raw)
In-Reply-To: <CAPpHfds-KiZRuCruc0jHxLSxLqzKcHJGwOFFA0b_RgaJvtUOEQ@mail.gmail.com>
References: <CABPTF7Xs-64GQNjmbimZNhj2YSKbBny+evz6=cp3X2fkJS+vMQ@mail.gmail.com>
<[email protected]>
<CAPpHfduDVNo4VXgnQFZUg9=2yHQJfUUqjokbi3qVxuJiKNfcwg@mail.gmail.com>
<CABPTF7UkwQZGx5ub731Q+=+rU8yx4ruqMdDt__L_dm9_32LsMw@mail.gmail.com>
<CAPpHfds-KiZRuCruc0jHxLSxLqzKcHJGwOFFA0b_RgaJvtUOEQ@mail.gmail.com>
Hi Alexander,
On Sat, Jan 3, 2026 at 6:54 AM Alexander Korotkov <[email protected]> wrote:
>
> Hi, Xuneng!
>
> On Fri, Jan 2, 2026 at 11:17 AM Xuneng Zhou <[email protected]> wrote:
> > On Fri, Jan 2, 2026 at 7:42 AM Alexander Korotkov <[email protected]> wrote:
> > >
> > > On Thu, Jan 1, 2026 at 7:16 PM Álvaro Herrera <[email protected]> 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.
> > >
> >
> > Thanks for pointing this out. This approach doesn’t scale to multiple
> > languages. While switch statements are more verbose, the extra clarity
> > is justified to preserve proper internationalization. Please check the
> > updated v12.
>
> I've corrected the patchset. Mostly changed just comments, formatting
> etc. I'm going to push it if no objections.
>
Thanks for updating the patchset. LGTM.
--
Best,
Xuneng
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Implement waiting for wal lsn replay: reloaded
In-Reply-To: <CABPTF7Vy4A0S0W7=B-fVd9Bo_15XG_FRYfKUF2CB_i=5svwEZQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox