

How BiHA Notifies about Cluster Events: Application in Proxima
Last year, we introduced built-in fault tolerance support in Postgres Pro Enterprise through BiHA. Our solution allows you to deploy a fault-tolerant Postgres cluster where, in the event of a failure of the primary node, a new primary node (leader) is automatically selected.
However, this brings up the issue of redirecting traffic to the new leader. This can be solved using our Proxima extension or an external TCP proxy server. Both solutions needed to periodically query the BiHA cluster to determine the primary node.
As an alternative, the latest version of BiHA introduced the ability to register custom functions that will be triggered by events such as leader change, node addition/removal, and others. We call this mechanism user callbacks. In this presentation, we’ll explain how the callbacks are implemented and discuss their usage.