Jeremy Schneider: Postgres recovery_prefetch Considered Harmful and Causing Outages
Another story of something I saw in the field which surprised me. Turns out recovery_prefetch can cause outages.
Something which has been happening quietly in the background all the time, but we didn’t notice until we looked close enough to see it.
After a lot of work I discovered this was partly a case where someone had dropped an email to the postgres hackers list years ago “hey what about this” and everyone thought “nah it can’t be that bad” … and now here we are seeing production outages!
Exhibit A: Feb 2021, while the feature was being developed, a year and a half before it shipped, Stephen Frost
Issuing unnecessary prefetches for blocks we’ve already sent a prefetch for is arguably a concern even if FPWs are off but the benefit of doing the prefetching almost certainly will outweight that and mean that finding a way to address it is something we could certainly do later as a future improvement. I wouldn’t have any issue with that. Just doesn’t seem as clear-cut to me when thinking about the FPW-enabled case. Ultimately, if you, Andres and Munro are all not concerned about it and no one else speaks up then I’m not going to pitch a fuss over it being c