Re: Invalid primary_slot_name triggers warnings in all processes on reload

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Invalid primary_slot_name triggers warnings in all processes on reload
Date: 2025-10-09 05:26:21
Message-ID: CAHGQGwHTJc58TsRjKO5FvL9joFqc-DM-C-KMNpqDGi0nO-7Puw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 9, 2025 at 2:06 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> Are you still planning to work on it?

Yes, thanks for the ping!
Attached is the updated version of the patch.

> Please note that since you're using already translated strings as
> arguments, you must use errmsg_internal() and errhint_internal(), to
> avoid doubly-translating these messages.

I've updated the patch to use errmsg_internal() and errhint_internal().
However, for GUCs, GUC_check_errdetail() and GUC_check_errhint() are
still used - and since they also translate their input, we might need
something like GUC_check_errdetail_internal() and
GUC_check_errhint_internal() to avoid double translation. Thought?
I haven't added those functions in the attached patch yet.

This isn't directly related to this thread, but while updating the patch,
I noticed that the call_xxx_check_hook() functions in guc.c use errhint()
instead of errhint_internal(). That might also cause double translation.
Interestingly, for log and detail messages they already use errmsg_internal()
and errdetail_internal(). Only the HINT messages still use the non-internal
version. Should we switch to use errhint_internal() as well?

> I am asking because it is better
> to fix this before merging the change for another somewhat related
> bug-fix patch being discussed in thread [1].

+1

> > BTW, about validating primary_slot_name in the check hook: I'm not sure
> > it's really worthwhile. Even without this validation, an invalid slot name
> > will raise an error anyway, and this validation can't catch all invalid cases.
> > So its value seems limited. If the check hook doesn't need to do
> > this validation, then ReplicationSlotValidateName() doesn't need to be
> > updated for that purpose.
> >
>
> Right. I think we can consider this separately just as a HEAD patch.

+1

Regards,

--
Fujii Masao

Attachment Content-Type Size
v4-0001-Make-invalid-primary_slot_name-follow-standard-GU.patch application/octet-stream 6.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2025-10-09 05:38:27 Re: pg_createsubscriber --dry-run logging concerns
Previous Message Amit Kapila 2025-10-09 05:23:54 Re: issue with synchronized_standby_slots