Re: [Proposal] Expose internal MultiXact member count function for efficient monitoring
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Naga Appani <nagnrik@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Kirill Reshke <reshkekirill@gmail.com>, pgsql-hackers@postgresql.org
Date: 2025-08-18T06:49:41Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add pg_get_multixact_stats()
- 97b101776ce2 19 (unreleased) landed
-
Add MultiXactOffsetStorageSize() to multixact_internal.h
- 0e3ad4b96aed 19 (unreleased) landed
-
Change GetMultiXactInfo() to return the next multixact offset
- 9cf746a453c1 19 (unreleased) landed
-
Widen MultiXactOffset to 64 bits
- bd8d9c9bdfa0 19 (unreleased) cited
-
Refactor ReadMultiXactCounts() into GetMultiXactInfo()
- a977e419ee6e 19 (unreleased) landed
-
Move SQL-callable code related to multixacts into its own file
- df9133fa6384 19 (unreleased) landed
-
Split func.sgml into more manageable pieces
- 4e23c9ef65ac 19 (unreleased) cited
On Sun, Aug 17, 2025 at 01:27:29AM -0500, Naga Appani wrote: > On Thu, Aug 7, 2025 at 7:35 PM Michael Paquier <michael@paquier.xyz> wrote: >> >> I really think that we should move the SQL function parts of multixact.c >> into their own new file, exposing ReadMultiXactCounts() in multixact.h... > > Done. The SQL-callable code now lives in > src/backend/utils/adt/multixactfuncs.c > and the accessor is declared in > src/include/access/multixact.h. My point was a bit different: multixactfuncs.c should be created first because we already have one SQL function in multixact.c that can be moved inside it, with the declarations it requires added to multixact.h. I've extracted what you did, moved the existing pg_get_multixact_members() inside the new file, and applied the result. >> ReadMultiXactCounts() is also incorrectly named with your proposal to >> expose oldestMultiXactId in the information returned to the caller... >> So perhaps this should be named GetMultiXactInformation() or something >> similar? > > Renamed to GetMultiXactInfo(). + * Returns information about current MultiXact state in a single atomic read: This comment is incorrect. This is not an atomic read, grabbing a consistent state of the data across one single lock acquisition. Except for this comment, this looks pretty much OK. Ashutosh, any comments? I have not looked at the rest. -- Michael