Re: Excessive number of replication slots for 12->14 logical replication

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Hubert Lubaczewski <depesz(at)depesz(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Excessive number of replication slots for 12->14 logical replication
Date: 2022-07-18 03:51:21
Message-ID: CAA4eK1JptEFUvxSFq=cQ=C703ENHuvvFoAA1a8oajRbX6o=GwA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Jul 16, 2022 at 3:44 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> On 2022-07-15 13:55:32 +0900, Kyotaro Horiguchi wrote:
> > Yeah, the limitation by max_sync_workers_per_subscription is performed
> > on subscriber, but replication slot drops happen not on the
> > subscriber, but at the termination of corresponding walsender process
> > on publisher.

We do drop the replication slots on subscribers since commit
ce0fdbfe97 once the initial sync is complete.

> > So, there's a lag between the finish of subscription
> > worker and the corresponding slot's drop. Thus, a new sync worker can
> > be created while the walsenders corresponding to some already finished
> > sync workers is still going to finish.
>
> Why are we relying on the slots being dropped at the end of connection? That
> doesn't seem like a good idea to me. Can't we just do that explicitly?
>

We do that explicitly once the initial sync in finished.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2022-07-18 06:55:30 BUG #17553: Unreleased file resources exist
Previous Message Amit Kapila 2022-07-18 03:37:35 Re: Excessive number of replication slots for 12->14 logical replication