pgsql: Fix checkpointer shared memory allocation

Поиск
Список
Период
Сортировка
Искать

pgsql: Fix checkpointer shared memory allocation

От:
Alexander Korotkov <akorotkov@postgresql.org>
Дата:
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 
Discussion: https://postgr.es/m/1439188.1754506714%40sss.pgh.pa.us
Author: Xuneng Zhou 
Co-authored-by: Alexander Korotkov 

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c5d66fc12b0891fd5f2a830ab9fa9feb8df94171

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

FAQ