pgsql: Fix checkpointer shared memory allocation - Mailing list pgsql-committers

From Alexander Korotkov
Subject pgsql: Fix checkpointer shared memory allocation
Date
Msg-id E1ujzIR-001DnC-2b@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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>

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2ac50f1187c2007f6ed581db6ee7240c5e5a37e6

Modified Files
--------------
src/backend/postmaster/checkpointer.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)


pgsql-committers by date:

Previous
From: Alexander Korotkov
Date:
Subject: pgsql: Fix checkpointer shared memory allocation
Next
From: Alexander Korotkov
Date:
Subject: pgsql: Fix checkpointer shared memory allocation