Skip to content

Add support for replication connections through PgBouncer

Problem

As documented:

When a Geo secondary site is replicating from a primary site that uses Patroni and PgBouncer, replicating through PgBouncer is not supported. The secondary must replicate directly from the leader node in the Patroni cluster.

When there is a failover in the Patroni cluster, you must manually reconfigure the follower in the secondary site.

A better configuration is, instead of replicating directly from the leader node, you should introduce an internal load balancer in the secondary site.

But, as mentioned in this document:

Linux packages do not include a Load Balancer

Proposal

For simplicity of documentation and configuration, allow sysadmins to replicate from PgBouncer.

  • Upgrade PgBouncer to at least 1.23.0.
  • Configure a follower through PgBouncer, then cause a failover in the Patroni cluster.
  • Adjust documentation.
Background