RE: ReplicationSlotRelease() crashes when the instance is in the single user mode - Mailing list pgsql-hackers

From Zhijie Hou (Fujitsu)
Subject RE: ReplicationSlotRelease() crashes when the instance is in the single user mode
Date
Msg-id OS0PR01MB57166E61D1B76022F3D440D194C42@OS0PR01MB5716.jpnprd01.prod.outlook.com
Whole thread Raw
In response to RE: ReplicationSlotRelease() crashes when the instance is in the single user mode  ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>)
Responses Re: ReplicationSlotRelease() crashes when the instance is in the single user mode
List pgsql-hackers
On Thursday, February 20, 2025 10:23 AM Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com> wrote:
>
> Dear Michael,
>
> > I did not check how these call behave individually, just a few
> > comments while putting my eyes on the patch.
> >
> > +    if (!IsUnderPostmaster)
> > +        elog(ERROR,
> > +             "slot operation is prohibited in the single user
> mode");
> >
> > elog() should not be used for failures that can be user-facing as this
> > would not provide any translation.
>
> I intentionally used elog() because I thought single user mode is not
> user-facing.
> But it is OK for me to use ereport() instead.
>
> > I'd suggest rewording the error message to provide some more context,
> > as well, say:
> > "cannot use %s in single-user mode", "function_name"
>
> Fixed. PSA new version

I'm curious about the scope of the restrictions we plan to add. For example,
the current patch does not include checks in the functions used for consuming
changes (such as pg_logical_slot_get_changes). Was this omission intentional?

Best Regards,
Hou zj



pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: Re: Commitfest app release on Feb 17 with many improvements
Next
From: Tatsuo Ishii
Date:
Subject: Re: Commitfest app release on Feb 17 with many improvements