]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix checkpointer shared memory allocation
authorAlexander Korotkov <akorotkov@postgresql.org>
Thu, 7 Aug 2025 11:29:02 +0000 (14:29 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Thu, 7 Aug 2025 11:31:25 +0000 (14:31 +0300)
commitc5d66fc12b0891fd5f2a830ab9fa9feb8df94171
tree9ed71aa36ae5c758b21df668543bdb7d66d936a0
parent0edaaa8f2978e9cce964d9815e6b2fbad9d76bd0
Fix checkpointer shared memory allocation

Use Min(NBuffers, MAX_CHECKPOINT_REQUESTS) instead of NBuffers in
CheckpointerShmemSize() to match the actual array size limit set in
CheckpointerShmemInit().  This prevents wasting shared memory when
NBuffers > MAX_CHECKPOINT_REQUESTS.  Also, fix the comment.

Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/1439188.1754506714%40sss.pgh.pa.us
Author: Xuneng Zhou <xunengzhou@gmail.com>
Co-authored-by: Alexander Korotkov <aekorotkov@gmail.com>
src/backend/postmaster/checkpointer.c