Re: [PATCH] Add max_logical_replication_slots GUC

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Ahmed Et-tanany <ahmed(dot)ettanany(at)aiven(dot)io>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Add max_logical_replication_slots GUC
Date: 2026-03-24 00:13:57
Message-ID: CAD21AoCB31azOSYNSdGfSi8reUzbPaj+e3C7uMC=rvLzeqMsNA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, Mar 9, 2026 at 11:55 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> On Thu, Jan 29, 2026 at 5:10 PM Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> >
> > On Wed, Jan 28, 2026 at 10:02 PM Ahmed Et-tanany
> > <ahmed(dot)ettanany(at)aiven(dot)io> wrote:
> > >
> > > Yes, that's what I meant.
> >
> > Would something like max_logical_wal_senders also be needed for your purpose?
> > Otherwise, logical replication connections could exhaust max_wal_senders and
> > prevent physical replication connections from being established.
> >
>
> I could be mistaken, but I haven’t found a way to start a logical
> replication stream without a replication slot. A replication
> connection and walsender can exist without a slot, for example:
> ./psql "host=localhost port=5432 user=user1 dbname=postgres
> replication=database"
>
> However, converting that connection to logical replication requires a
> slot from the max_logical_replication_slots pool. If that pool is
> exhausted, the connection cannot be converted — in which case,
> wouldn’t a single GUC suffice?

In an extreme case like where if all walsenders are used up by logical
walsender who are just connecting and not using logical replication
slots, physical replication cannot start even if there is a free
physical replication slot. But I think it's sufficient to have
something like max_logical_replication_slots in most cases. So a
single GUC seems to suffice unless I'm not missing some cases.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message KAZAR Ayoub 2026-03-24 00:16:37 Re: Speed up COPY TO text/CSV parsing using SIMD
Previous Message David Rowley 2026-03-24 00:12:17 Re: Fix "could not find memoization table entry"