I have an RDS multi-AZ postgres database (primary-standby) and I'm investigating Debezium to stream changes to Kafka.
I was reading the documentation of what could go wrong in case of failover: https://debezium.io/documentation/reference/1.1/connectors/postgresql.html#_cluster_failures and it looks like a pretty scary scenario.
From some tests I made by rebooting with failover, it seems that when the endpoint changes from the primary to the standby the Debezium connector keeps working and automatically creates a replication slot on the standby. But from what I understand there's no guarantee that there won't be data loss unless you can ensure that the replication slot on the new primary (the old standby) is created before new data is written.
Does anybody have experience with this setup? How do you manage things in case of failover?