Using permanent replication slots with Patroni and PostgreSQL

637 views
Skip to first unread message

Hrvoje Djurdjevic

unread,
Jul 5, 2021, 9:11:54 AM7/5/21
to debezium
Hi, 

is this a possible solution described here:
when switchover/failover occurs using Patroni with PostgreSQL, and Debezium replication slot is not automatically recreated on the node which becomes active, 
or maybe to use on_role_change call back script and add there commands to create replication slot?
Does anybody have experience with it? 
Thanks in advance.

Best regards,
Hrvoje

Chris Cranford

unread,
Jul 5, 2021, 11:49:34 PM7/5/21
to debe...@googlegroups.com, Hrvoje Djurdjevic
hi Hrvoje -

The main issue with the replication slot is if is being "recreated", it will not necessarily have the exact same state as the replication slot on the primary and therefore you run the risk that data will be lost in the CDC pipeline.  There was discussion sometime ago where the PostgreSQL devs and contributors were looking at ways to provide "failover" replication slots for this reason.  I'm not sure of its current status but currently afaik we haven't implemented any such support for that in Debezium.
--
You received this message because you are subscribed to the Google Groups "debezium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debezium+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/debezium/c3fec7c4-7ce4-4264-8d5b-731c9dfeb137n%40googlegroups.com.

Gunnar Morling

unread,
Jul 7, 2021, 3:47:54 AM7/7/21
to debezium
That notion of "permanent replication slots" in Patroni is interesting, though. From reading their docs, it seems like Patroni manages a replication slot on stand-by nodes which then could be used after a fail-over.

I also came across another Postgres extension which aims to provide fail-over slot support (see https://issues.redhat.com/browse/DBZ-3064). I'd love for someone to give these different solutions a try and let us know how it goes.

--Gunnar
Reply all
Reply to author
Forward
0 new messages