]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix calculation of members_size in pg_get_multixact_stats()
authorMichael Paquier <michael@paquier.xyz>
Tue, 26 May 2026 04:49:04 +0000 (13:49 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 26 May 2026 04:49:04 +0000 (13:49 +0900)
commit6aa26be288fa811270dfc1e39c015c23a97688b4
treebb0be1e72e6ada4acc2fc6f42f19f1fef771d255
parentd40aed554227e5f8203798fda25b936a264638ec
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 <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/819AC1B2-1A71-4244-B081-3ADD85D1725D@gmail.com
src/include/access/multixact_internal.h
src/test/isolation/expected/multixact-stats.out
src/test/isolation/specs/multixact-stats.spec