DEV Community

Annie Ghazali
Annie Ghazali

Posted on

Inside a PostgreSQL Checkpointer Bug: A Production Postmortem

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. In this article, @warda_bibi_ explains what happened, why manual checkpoints couldn’t fix it, and how a PostgreSQL minor version upgrade permanently resolved the issue.

Read more: https://stormatics.tech/blogs/postgresql-checkpointer-bug-causing-infinite-retry-loop

Top comments (0)