Re: ReplicationSlotRelease() crashes when the instance is in the single user mode

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: Paul A Jungwirth <pj@illuminatedcomputing.com>, Mutaamba Maasha <maasha@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>, Michael Paquier <michael@paquier.xyz>, "David G. Johnston" <david.g.johnston@gmail.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, Tom Lane <tgl@sss.pgh.pa.us>, Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2025-08-13T20:04:04Z
Lists: pgsql-hackers
On Wed, Aug 13, 2025 at 3:21 AM Hayato Kuroda (Fujitsu)
<kuroda.hayato@fujitsu.com> wrote:
> To confirm; your point is that we should firstly fix to allow acquiring/releasing
> slots in the mode, then consider additional guards, is it right? Valid point.

Yes.

> I still cannot find enough use-cases to allow manipulating slots, though.

The use case for single-user mode is quite limited in general, but
most things work in single-user mode unless they are something that
intrinsically can't. For example, parallel query cannot be used in
single-user mode, because there is only one process. Replication
cannot work, for the same reason. But manual slot operations can work,
so I do not think it is good to arbitrarily prohibit them. We do not
need a reason to specifically allow them; it is enough that there is
no good reason for them to be blocked.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



Commits

  1. Fix assertion failure with replication slot release in single-user mode