Re: pg_createsubscriber: drop pre-existing subscriptions from the converted node

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Euler Taveira <euler(at)eulerto(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Subject: Re: pg_createsubscriber: drop pre-existing subscriptions from the converted node
Date: 2024-06-28 11:07:05
Message-ID: CAA4eK1+Gfmm3+w_dWPisvkjAgyPS+LLN6jhJj7yeA6LzczQqaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 27, 2024 at 11:47 AM Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)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 Content-Type Size
v3-0001-pg_createsubscriber-Drop-pre-existing-subscriptio.patch application/octet-stream 10.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuro Yamada 2024-06-28 11:16:03 Re: Showing applied extended statistics in explain Part 2
Previous Message Robins Tharakan 2024-06-28 10:20:08 Re: recoveryCheck/008_fsm_truncation is failing on dodo in v14- (due to slow fsync?)