Peter Eisentraut: pg_failover_slots: The missing piece (PGConf.EU 2023)

PGFailover Slots: The Missing Piece in PostgreSQL Replication for Seamless Failover and Effective Replication Slot Management

Key takeaways
  • pg_failover_slots is a missing piece in Postgres replication that solves the problem of failover without quorum.
  • It’s a plug-in that connects to the primary and standby nodes, and allows for logical log sequence number (LSN) syncing.
  • The plug-in can be used to set up a new replication slot, and to sync the slots on the primary and standby nodes.
  • It’s a lightweight solution that doesn’t require restarting the database or rewriting the replication code.
  • The plug-in can be used to solve the problem of cascading physical replication, where physical replicas are never ahead of the primary node.
  • It can also be used to solve the problem of logical applications, where data is replicated to multiple nodes and the logical LSN is not the same as the physical LSN.
  • The plug-in is available for all supported Postgres major versions, including 11, 12, and 13.
  • It’s been tested in production and has been shown to be efficient and low-overhead.
  • The plug-in is open-source and can be used for free.
  • It’s available on GitHub and can be installed using the usual package manager for Postgres.
  • The plug-in can be configured to sync specific replication slots, and can be used to solve the problem of inconsistent data between nodes.
  • It’s a solution that’s been worked on by the Postgres community and has been tested and validated by multiple users.
  • It’s a solution that’s easy to use and doesn’t require a deep understanding of Postgres replication.
  • It’s a solution that can be used to solve the problem of logical log sequence number (LSN) syncing, and can be used to set up a new replication slot.
  • It’s a solution that can be used to solve the problem of cascading physical replication, where physical replicas are never ahead of the primary node.
  • It’s a solution that can be used to solve the problem of logical applications, where data is replicated to multiple nodes and the logical LSN is not the same as the physical LSN.