warda bibi: Inside a PostgreSQL Checkpointer Bug: A Production Postmortem
PostgreSQL Planet1mo4 min read
One of our client’s PostgreSQL 16.8 production databases started logging what looked like a memory error: ERROR: invalid memory alloc request size The error immediately pointed toward two likely suspects: Memory exhaustion Memory corruption As it turned out, neither was the culprit. Instead, it had encountered a known PostgreSQL bug that trapped the checkpointer in an infinite retry loop. The only way to recover was a forced restart, followed by an extended period of WAL replay during crash recovery. This article explains what happened, why manual checkpoints couldn’t fix it, and how a Postgre