pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix checkpointer shared memory allocation
Date: Thu, 07 Aug 2025 12:00:40 +0000
Message-ID: <E1ujzIV-001DoA-2n@gemulon.postgresql.org> (raw)

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_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7f872ae7020e6772ea7a6355c8d3c3be648016a2

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



view thread (7+ messages)

Message-ID: <E1ujzIV-001DoA-2n@gemulon.postgresql.org>
Permalink:  ../E1ujzIV-001DoA-2n@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ujzIV-001DoA-2n@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: akorotkov@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix checkpointer shared memory allocation
  In-Reply-To: <E1ujzIV-001DoA-2n@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox