mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
The Postgres logical decoding protocol is lacking documentation and unclear about keepalive behavior when `wal_sender_timeout` is set to 0 (disabled). We have it disabled so that Postgres doesn't terminate our connection for falling too far behind. What we failed to take into account is that on some installations, Postgres _never_ requests an immediate reply (keepalive with the reply now bit set) if wal_sender_timeout is disabled. This means we would always reply with the empty message, failing to advance the position of the LSN. In this PR, we fix that to always respond to every keepalive message with a standby status update to advance the LSN position. Relevant documentation: https://www.postgresql.org/docs/current/protocol-replication.html#PROTOCOL-REPLICATION-STANDBY-STATUS-UPDATE
Domain
Phoenix app for managing Firezone.