On Wed, Sep 17, 2025, at 1:23 AM, Nathan Bossart wrote:
> I drafted up what that would look like. One very small nitpick is that it
> messes up the alignment of the pg_controldata output. Otherwise, it seems
> pretty straightforward.
>
As Masahiko said this behavior is not new in v18 so I wouldn't consider fix it
to v18.
I don't think your patch works for one detail: StartupReplicationOrigin() is
called earlier than CheckRequiredParameterValues(). The
StartupReplicationOrigin() uses max_active_replication_origins to emit the
PANIC message. I didn't check the implications to postpone the
StartupReplicationOrigin(). Maybe an ugly solution is to check the
max_active_replication_origins inside or even before calling
StartupReplicationOrigin().
I'm attaching a script that I used to simulate the issue. Change the GUC name
to simulate the issue in a pre v18.
--
Euler Taveira
EDB https://www.enterprisedb.com/