public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: [email protected]
Subject: pgsql: Fix calculation of members_size in pg_get_multixact_stats()
Date: Tue, 26 May 2026 04:50:08 +0000
Message-ID: <[email protected]> (raw)

Fix calculation of members_size in pg_get_multixact_stats()

pg_get_multixact_stats() uses members_size to report the amount of
storage used by the currently retained multixact members.  However,
MultiXactOffsetStorageSize() divided the member count by the number of
members per storage group before multiplying by the group size, so it
was rounding down its result and incorrectly reported zero when there
were few retained members.  The calculation is changed to calculate the
same based on the member count.

While on it, this fixes a different issue in the isolation test
multixact-stats.  Three fields were defined for checks related to the
oldest offset values, but were not used.  The offsets existed in an
older version of the patch than what has been committed.  These are
replaced by checks for members_size, checking the new calculation
formula.

Thinkos introduced in 97b101776ce2.

Author: Chao Li <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6aa26be288fa811270dfc1e39c015c23a97688b4

Modified Files
--------------
src/include/access/multixact_internal.h         |  6 +++--
src/test/isolation/expected/multixact-stats.out | 31 ++++++++++++++-----------
src/test/isolation/specs/multixact-stats.spec   | 30 +++++++++++++++---------
3 files changed, 40 insertions(+), 27 deletions(-)



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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Fix calculation of members_size in pg_get_multixact_stats()
  In-Reply-To: <[email protected]>

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

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