pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Euler Taveira <euler@eulerto.com>
To: Nathan Bossart <nathandbossart@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Nazneen Jafri <jafrinazneen@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Read Replica termination occurs when its max_active_replication_origins setting is lower than the primary
Date: Wed, 17 Sep 2025 19:34:56 -0300
Message-ID: <fb6cbb5a-43e0-4da0-9008-3e583b41a230@app.fastmail.com> (raw)
In-Reply-To: <aMo3tsESKXh6MCVp@nathan>
References: <CA+m5N8uciiyzVOBb+ncadQutLoMOFaqN13Phq+r_neZm2vd5gQ@mail.gmail.com>
	<CAD21AoAWGp5q9w7bN024NGT7QL=1Vw3PcqGBLbE35XGnT_JzpQ@mail.gmail.com>
	<aMog06qbmvLLcFSw@nathan>
	<CAD21AoB3kcrVnTxHX+F=MOt_DWHdKFBLKaBBeOcsUyW6jWEMfQ@mail.gmail.com>
	<aMo3tsESKXh6MCVp@nathan>

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/

Attachments:

  [application/x-shellscript] test-maro.sh (3.8K, ../fb6cbb5a-43e0-4da0-9008-3e583b41a230@app.fastmail.com/2-test-maro.sh)
  download

view thread (8+ messages)

Message-ID: <fb6cbb5a-43e0-4da0-9008-3e583b41a230@app.fastmail.com>
Permalink:  ../fb6cbb5a-43e0-4da0-9008-3e583b41a230@app.fastmail.com/
Also on:    postgresql.org/message-id/fb6cbb5a-43e0-4da0-9008-3e583b41a230@app.fastmail.com

 · 

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: pgsql-bugs@postgresql.org
  Cc: euler@eulerto.com, nathandbossart@gmail.com, sawada.mshk@gmail.com, jafrinazneen@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: Read Replica termination occurs when its max_active_replication_origins setting is lower than the primary
  In-Reply-To: <fb6cbb5a-43e0-4da0-9008-3e583b41a230@app.fastmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox