Re: Shmem allocated wrong for custom cumulative stats

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2026-04-07T03:04:35Z
Lists: pgsql-hackers
On Mon, Apr 06, 2026 at 12:14:06PM +0900, Michael Paquier wrote:
> The attached is working correctly.  The v18 flavor is slightly
> simpler.

I have looked at it again today, and noticed that the test modules of
both HEAD and REL_18_STABLE were incorrect in the values they set for
shared_size for the fixed-sized cases.  In both cases we were
finishing with an underestimation.  I could only see a direct impact
on HEAD for the 32-bit builds, though, but the problem was the same.

The allocation has been fixed in 17132f55c5a2, with the modules
handled by 98979578055f.
--
Michael

Commits

  1. Fix shmem allocation of fixed-sized custom stats kind

  2. Fix shared memory size of template code for custom fixed-sized pgstats