]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Limit checkpointer requests queue size
authorAlexander Korotkov <akorotkov@postgresql.org>
Sun, 27 Jul 2025 12:10:01 +0000 (15:10 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Sun, 27 Jul 2025 12:10:02 +0000 (15:10 +0300)
commitbae50782170c9de8aa13700423923a5bb9d6b9e9
tree5ea0341658ee3df7b9feddbf081a4de67198f502
parent75f633f54aaae4d20ea0ade9a953afa73e3a66e8
Limit checkpointer requests queue size

If the number of sync requests is big enough, the palloc() call in
AbsorbSyncRequests() will attempt to allocate more than 1 GB of memory,
resulting in failure.  This can lead to an infinite loop in the checkpointer
process, as it repeatedly fails to absorb the pending requests.

This commit limits the checkpointer requests queue size to 10M items. In
addition to preventing the palloc() failure, this change helps to avoid long
queue processing time.

Also, this commit is for backpathing only.  The master branch receives
a more invasive yet comprehensive fix for this problem.

Discussion: https://postgr.es/m/db4534f83a22a29ab5ee2566ad86ca92%40postgrespro.ru
Backpatch-through: 13
src/backend/postmaster/checkpointer.c