A field incident revealed that the PostgreSQL `recovery_prefetch` feature can cause production outages, particularly in synchronous replication setups. The issue stems from unnecessary prefetch calls when shared buffers are loaded from WAL Full Page Writes (FPWs) rather than disk, leading to significant replay lag on physical standbys. Historical mailing list discussions from 2021 and 2025 raised concerns but lacked a complete diagnosis.
The core problem is IOPS amplification: large sequential I/O on the primary is converted into 8k random reads on replicas, exhausting available IOPS and causing replicas to lag. This is exacerbated by the common use of synchronous replication for data protection. Disabling `recovery_prefetch` resolves the issue.
The feature, designed to improve recovery performance, instead introduces instability in modern high-availability environments.
Source: Hacker News · Summarized by HeadlinesBriefing