Continue Logical Replication After Master Became Slave and then Became Master Again

From: Avi Weinberg <AviW(at)gilat(dot)com>
To: pgsql-generallists(dot)postgresql(dot)org <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Continue Logical Replication After Master Became Slave and then Became Master Again
Date: 2024-12-15 17:41:05
Message-ID: DB9PR07MB71806094127BF5936A6DB07ACB3A2@DB9PR07MB7180.eurprd07.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All,

Postgres 15.2

We have Patroni cluster with one master and two replicas. The master is publisher (logical replication) to some subscriptions running on other clusters. When we have a failover, the master becomes replica and one of the replicas assume the role of master. In such a case, we need to rebuild the subscriptions to point to the new master. However, to avoid that, can we just do fallback and move back to the old master assuming the following options - what if:

1. No data was written to the database from the time of the failover until the failback
2. No data was written to the replicated tables (but other tables were updated) from the time of the failover until the failback
3. The replicated tables were updated from the time of the failover until the failback

Thanks

IMPORTANT - This email and any attachments is intended for the above named addressee(s), and may contain information which is confidential or privileged. If you are not the intended recipient, please inform the sender immediately and delete this email: you should not copy or use this e-mail for any purpose nor disclose its contents to any person.

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2024-12-15 17:46:42 Re: Request for new column in pg_namespace
Previous Message Isaac Morland 2024-12-15 17:40:12 Re: Request for new column in pg_namespace