Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ukB5Z-00Ggk2-4b for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Aug 2025 00:36:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ukB5V-00HWDV-L7 for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Aug 2025 00:36:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ukB5V-00HWDG-2L for pgsql-hackers@lists.postgresql.org; Fri, 08 Aug 2025 00:36:01 +0000 Received: from fhigh-b5-smtp.messagingengine.com ([202.12.124.156]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1ukB5S-001J4y-0W for pgsql-hackers@postgresql.org; Fri, 08 Aug 2025 00:36:00 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfhigh.stl.internal (Postfix) with ESMTP id 806057A0105; Thu, 7 Aug 2025 20:35:58 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Thu, 07 Aug 2025 20:35:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1754613358; x=1754699758; bh=rdfg9+JKUY 0VUJl0APknn+XK6SHup0WQxqMH0+A0JuM=; b=ZJXeB2gsEdF2YWftFn4qeutbal n/LvgtmwTl5BBhvGmXVFUwML4rC639rrE6DNpaab42kEItqp1yZWzTqUEJ398bmJ WNelCO8jkOH3yOahQtUS9Zt7UTGN7AR9X8JUBWRH4mV45l+5vrGzE9CDepKS2NqZ KsPn19+VFkiBojHW9kJIwEiPzXWeixrHfwr8aexT+iqv3vjWDUxyACEmkQE64ElG 4bcHo2Ys7Yx+etybsGfON8DdD7iXk4f/k+e8tg1DuVT72f80AF6bfC2hSwWJoc7y kcctoTZehN1/TFQ1fZHZdpKYKzMCnWLg/SuoP0wYvwBvCB8SKVpkhoZvDpoQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1754613358; x=1754699758; bh=rdfg9+JKUY0VUJl0APknn+XK6SHup0WQxqM H0+A0JuM=; b=Ru22QH+u8bNb4fH6N2T7GcKxP4/5H69Ugb1Pip8S8knZTtTB0pV GsEKk4Vl8L0hsQJY5I4tAuy58i3KB0NNEe2vOye4OON1k/mritG2+pw8QP+K3zHj vUyhUnNjSXpMDjwUOzMd2CnmSQzODrmbYNoOJiY5nlrrdU9y4v9yGyrPn9TTV17R /1ZNk1tHAV2ZfJRFnd21uk+E1eXnOY/EM02WShO/lXSnr33MSA5ut0I980LlP1IY Tjhs+w1HWQNE6pbHkMOPCH6VzE4uRnMix/e1F+p5DGfkneiV43X5cA6r1nn2owYc wYQPZyeLRU7MrFqRe/MWhI9dLMRm7sOPQZQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdduvddvfeelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepnhgrgh hnrhhikhesghhmrghilhdrtghomhdprhgtphhtthhopegrshhhuhhtohhshhdrsggrphgr thdrohhsshesghhmrghilhdrtghomhdprhgtphhtthhopehrvghshhhkvghkihhrihhllh esghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhs thhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 7 Aug 2025 20:35:55 -0400 (EDT) Date: Fri, 8 Aug 2025 09:35:52 +0900 From: Michael Paquier To: Naga Appani Cc: Ashutosh Bapat , Kirill Reshke , pgsql-hackers@postgresql.org Subject: Re: [Proposal] Expose internal MultiXact member count function for efficient monitoring Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DSmitDN0SMmCWxZA" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --DSmitDN0SMmCWxZA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 04, 2025 at 04:51:30PM -0500, Naga Appani wrote: > The rest of the patch remains the same as v2, which incorporated > feedback from Ashutosh and Michael (see my previous email for > details). >=20 > Please find v3 attached. I am reading again what you have here, and I really think that we should move the SQL function parts of multixact.c into their own new file, exposing ReadMultiXactCounts() in multixact.h, because I also suspect that this can become really useful for extensions that aim at doing things similar to your proposal in terms of data monitoring for autovacuum wraparound. This means two refactoring patches: - One to expose the new routine in multixact.h. - One to move the existing SQL code to its new file.=20 ReadMultiXactCounts() is also incorrectly named with your proposal to expose oldestMultiXactId in the information returned to the caller, where the key point is to make sure that the information retrieved is consistent across a single LWLock acquisition. So perhaps this should be named GetMultiXactInformation() or something similar? The top of ReadMultiXactCounts() (or whatever its new name) should also document the information returned across a single call. It looks inconsistent to return oldestMultiXactId if the oldestOffsetKnown is false. What about oldestOffset itself? Should it be returned for consistency with the counts and oldestMultiXactId? -- Michael --DSmitDN0SMmCWxZA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmiVRmgACgkQnvQgOdby QH0vCw//RhmISJgx0NTKbnJK4wQV8huysWR6wTpu+4r5RGVqBHuelkGTvnFT7XS9 NL1QqKe0lNACtqTWysXOnYv4Kh+TgMP2OUy1p5L2cPciprdfc23Q/QFOGSWbl05U GQDkELfY5w73ksY3h1SZ/8TijDdTuf2JqYMCjhTrN1D30Meyl201FdrRzY69OKaj zYCBWs9/IUHXbR66dS6xcFXCIs2bNM0MPHyRA3YlVbzkTC1SeUIB32bLZ4HCEVmD RzrNGZ19cT3DeAhg7u+CBDfp9+bvmUrQI6Co3W38zMbrt5J+RiJI3cM/vopY8ZdE GEFIUJrEvmCqedvVIJkQqkftItQIuzdS1E0CXdyBFfUwi2gbX0CRSjKdRrsrgx9r nx7A/ouJjMRXV5SYeAraMVJUGqLwamWUdfleaIH9WKD03Upr+NsXswD5mffM+zZK yHbO1nsX4Gb944cchVAAgsPvbIzC4vJMvJBDzUsMGb/Pq0+Zm70VPSQdfbmq0BAJ WRCkZevHpckEiTcKzvkLl54hxhQYPKlNKoxwKhw/QQUqKnmsGy8NbXk6xh+HwwV9 fn2F2mGUMgAO6zhletFfoP7WSmVqLg7rxSqoBUIPg7RR4COYZUsrNXUtZlibmDyB Vl7p0cCpqJxN4ISsRO4bq6aG2sW2RKqtk1Wx9pdApylfXIZs/f4= =jmIT -----END PGP SIGNATURE----- --DSmitDN0SMmCWxZA--