Hot standby feedback
Hot standby feedback is PostgreSQL's mechanism for reporting standby query retention needs upstream to defer conflicting row cleanup.
It can prevent cleanup-related query cancellations but retain dead rows and cause primary-side bloat; the default is off. [1] It does not configure commit acknowledgements. [4]
Messages are sent at most once per wal_receiver_status_interval, whose default is 10 s, and cascading standbys pass them upstream until they reach the primary. Moving the standby clock forward or backward can delay messages and leave dead rows unremoved on the primary for long periods. [1]
In the PostgreSQL 18 WAL receiver each feedback message is 25 bytes, a type byte, an 8-byte timestamp and four 32-bit fields for xmin, catalog_xmin and their epochs. After feedback is turned off, the receiver sends invalid horizons once so the upstream can release the held xmin. [5]
For streaming WAL, max_standby_streaming_delay is a replay-delay budget after receipt, not a per-query runtime allowance. A later conflicting query can have less grace because of earlier replay delays. For conflicts governed by this delay setting, -1 allows waiting without that time limit; a finite value is not an end-to-end commit deadline. These delay controls are separate from feedback and commit acknowledgement policy. [6] [2]
Relations
- related
- Replication slot, Logical failover slot, Logical decoding, Snapshot isolation, Synchronous replication
Advantages
- Cleanup on the primary is no worse than if the same queries ran there directly, while their execution stays on the standby. [2]
Limitations
- Feedback does not eliminate every recovery conflict, including Access Exclusive locks and drops of tables, databases or tablespaces. [2]
- Slot synchronization needs a persistent physical upstream slot, which can be the existing streaming slot; feedback alone does not protect needed catalog history during a disconnection. [3]
- While a standby is disconnected no feedback is provided, so archive and streaming delay settings may still need raising. [2]
Citations
- PostgreSQL 18: hot_standby_feedback
- PostgreSQL 18: handling query conflicts on hot standby
- PostgreSQL 18: replication slot synchronization
- Hesela: Replication acknowledgements and logical failover readiness
- PostgreSQL 18.0 src/backend/replication/walreceiver.c: XLogWalRcvSendHSFeedback
- PostgreSQL 18: max_standby_streaming_delay
Sources & caveats
- pg-feedback is the PostgreSQL 18 replication settings page, reread on the access date for hot_standby_feedback and wal_receiver_status_interval.
- pg-conflicts is the PostgreSQL 18 hot standby page, reread in section 26.4.2.
- walreceiver is src/backend/replication/walreceiver.c at tag REL_18_0, read in XLogWalRcvSendHSFeedback.
- 10 s comes from pg-feedback. 25 bytes, 8-byte and 32-bit come from walreceiver as 1 + 8 + 4 x 4 bytes.
- PostgreSQL 18 standby conflict and delay documentation reviewed on 2026-11-01; no replication experiment or commit-latency bound is claimed.