Is it safe to transfer logical replication publication/subscription? - Mailing list pgsql-general

From Mike Lissner
Subject Is it safe to transfer logical replication publication/subscription?
Date
Msg-id CAMp9=EwMa=LVtFhFZeYUyO7EzLLKiy3A6vA5tG-pyBq4S52QFw@mail.gmail.com
Whole thread Raw
Responses Re: Is it safe to transfer logical replicationpublication/subscription?
List pgsql-general
Hi all, this is a follow up from an earlier question I asked about
shortening a chain of logically replicating servers. Right now we have
three servers replicating like this:

A --> B --> C

And we want to remove B so that we have:

A --> C

Is it possible to DROP the subscription on B to A and then to
SUBSCRIBE C to the previously used publication on A without losing
data?

E.g., assuming the following:

 - "A" has a PUBLICATION named "A-to-B-Pub" that "B" subscribes to.
 - "C" subscribes to "B" with a subscription named "B-to-C-Sub".

Would this work?

1. On B, DROP the subscription to "A-to-B-Pub".

2. Let any cached changes on B flush to C. Give it an hour to be sure.

3. On C ALTER  "B-to-C-Sub" to subscribe to the now-used "A-to-B-Pub" on A.

Seems like this would either work perfectly or totally fail. Any ideas?

Thanks for any help,


Mike



pgsql-general by date:

Previous
From: Mike Lissner
Date:
Subject: Re: How to shorten a chain of logically replicated servers
Next
From: Peter Eisentraut
Date:
Subject: Re: Is it safe to transfer logical replicationpublication/subscription?