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 via email to