Notes on physical replica failover with logical publisher or subscriber

From: Craig Ringer <craig(dot)ringer(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)ru>, Petr Jelinek <petr(dot)jelinek(at)enterprisedb(dot)com>, Markus Wanner <markus(dot)wanner(at)enterprisedb(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Notes on physical replica failover with logical publisher or subscriber
Date: 2020-11-30 03:59:38
Message-ID: CAGRY4nx0-ZVnFJV5749QCqwmqBMkjQpcFkYY56a9U6Vf+f7-7Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all

I recently wrote some notes on interaction between physical
replication failover/promotion and logical replication publisher
and/or standby.

As you probably all know, right now we don't support physical failover
for logical replication publishers at all, either for in-core logical
replication or for 3rd party solutions. And while we support physical
failover and promotion of subscribers, there turn out to be some
issues with that too.

I'm not trying to solve those issues right now. But since there are
various out-of-tree replication tools trying to work around these
limitations, I wanted to share my knowledge of the various hazards and
challenges involved in doing so, so I've written a wiki article on it.

https://wiki.postgresql.org/wiki/Logical_replication_and_physical_standby_failover

I tried to address many of these issues with failover slots, but I am
not trying to beat that dead horse now. I know that at least some
people here are of the opinion that effort shouldn't go into
logical/physical replication interoperation anyway - that we should
instead address the remaining limitations in logical replication so
that it can provide complete HA capabilities without use of physical
replication. So for now I'm just trying to save others who go looking
into these issues some time and warn them about some of the less
obvious booby-traps.

I do want to add some info to the logical decoding docs around slot
fast-forward behaviour and how to write clients to avoid missing or
double-processing transactions. I'd welcome advice on the best way to
do that in a manner that would be accepted by this community.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rosen Penev 2020-11-30 04:33:41 [PATCH] fix compilation with gnu89
Previous Message Krunal Bauskar 2020-11-30 03:59:37 Re: Improving spin-lock implementation on ARM.