From a977e419ee6ee15cb7bd45d7c9b7540cf183d1e2 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Tue, 19 Aug 2025 14:04:09 +0900 Subject: Refactor ReadMultiXactCounts() into GetMultiXactInfo() This provides a single entry point to access some information about the state of MultiXacts, able to return some data about multixacts offsets and counts. Originally this function was only able to return some information about the number of multixacts and multixact members, extended here to provide some data about the oldest multixact ID in use and the oldest offset, if known. This change has been proposed in a patch that aims at providing more monitoring capabilities for multixacts, and it is useful on its own. GetMultiXactInfo() is added to multixact.h, becoming available for out-of-core code. Extracted from a larger patch by the same author. Author: Naga Appani Reviewed-by: Ashutosh Bapat Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/CA+QeY+AAsYK6WvBW4qYzHz4bahHycDAY_q5ECmHkEV_eB9ckzg@mail.gmail.com --- src/include/access/multixact.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/include/access') diff --git a/src/include/access/multixact.h b/src/include/access/multixact.h index 6607b645a18..82e4bb90dd5 100644 --- a/src/include/access/multixact.h +++ b/src/include/access/multixact.h @@ -111,6 +111,9 @@ extern bool MultiXactIdIsRunning(MultiXactId multi, bool isLockOnly); extern void MultiXactIdSetOldestMember(void); extern int GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members, bool from_pgupgrade, bool isLockOnly); +extern bool GetMultiXactInfo(uint32 *multixacts, MultiXactOffset *members, + MultiXactId *oldestMultiXactId, + MultiXactOffset *oldestOffset); extern bool MultiXactIdPrecedes(MultiXactId multi1, MultiXactId multi2); extern bool MultiXactIdPrecedesOrEquals(MultiXactId multi1, MultiXactId multi2); -- cgit v1.2.3