Re: pg_createsubscriber: drop pre-existing subscriptions from the converted node - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: pg_createsubscriber: drop pre-existing subscriptions from the converted node
Date
Msg-id CAA4eK1+Gfmm3+w_dWPisvkjAgyPS+LLN6jhJj7yeA6LzczQqaQ@mail.gmail.com
Whole thread Raw
In response to RE: pg_createsubscriber: drop pre-existing subscriptions from the converted node  ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>)
Responses RE: pg_createsubscriber: drop pre-existing subscriptions from the converted node
List pgsql-hackers
On Thu, Jun 27, 2024 at 11:47 AM Hayato Kuroda (Fujitsu)
<kuroda.hayato@fujitsu.com> wrote:
>
> > It seems disabling subscriptions on the primary can make the primary
> > stop functioning for some duration of time. I feel we need some
> > solution where after converting to subscriber, we disable and drop
> > pre-existing subscriptions. One idea could be that we use the list of
> > new subscriptions created by the tool such that any subscription not
> > existing in that list will be dropped.
>
> Previously I avoided coding like yours, because there is a room that converted
> node can connect to another publisher. But per off-list discussion, we can skip
> it by setting max_logical_replication_workers = 0. I refactored with the approach.
> Note that the GUC is checked at verification phase, so an attribute is added to
> start_standby_server() to select the workload.
>

Thanks, this is a better approach. I have changed a few comments and
made some other cosmetic changes. See attached.

Euler, Peter E., and others, do you have any comments/suggestions?

BTW, why have you created a separate test file for this test? I think
we should add a new test to one of the existing tests in
040_pg_createsubscriber. You can create a dummy subscription on node_p
and do a test similar to what we are doing in "# Create failover slot
to test its removal".

--
With Regards,
Amit Kapila.

Attachment

pgsql-hackers by date:

Previous
From: Robins Tharakan
Date:
Subject: Re: recoveryCheck/008_fsm_truncation is failing on dodo in v14- (due to slow fsync?)
Next
From: Tatsuro Yamada
Date:
Subject: Re: Showing applied extended statistics in explain Part 2