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 1tYZY3-00C1XR-KS for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Jan 2025 23:45:16 +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 1tYZX3-003lhk-Rd for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Jan 2025 23:44:14 +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 1tYZX3-003lhc-Hl for pgsql-hackers@lists.postgresql.org; Thu, 16 Jan 2025 23:44:14 +0000 Received: from fout-b5-smtp.messagingengine.com ([202.12.124.148]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tYZX2-000mtG-0H for pgsql-hackers@lists.postgresql.org; Thu, 16 Jan 2025 23:44:12 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id 908171140125; Thu, 16 Jan 2025 18:44:10 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Thu, 16 Jan 2025 18:44:10 -0500 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=fm2; t=1737071050; x=1737157450; bh=G/EIJ+XZP5 dgGm+wjnGPtupcYepJhWj5R64p76nFaKM=; b=hSHjw4yFx4wL+6gRY/kx+J3ltt ZXmfBZo+UbO2RJt/x/X2lVdGt+EKffCwM2shZGMoWFxSEkR66Ed/OsisKo4pxY78 5oUoU8gwOUoliqPd5FhS/YnvvYqj6O7t1rfi7Bc/rr72LleaGkJ2nXippHK9nnCD 3Sfhdns4+CxqZTAdlVeCHXeqewNa09FauAknNGEXRnzrXzzUxZD7T/ugVoJyO9T5 tuxdDsNMld5m5Uhg6J0sU/eQRBOSyaE11lLuqr0vnUzRxVjRxPGbo7TfXeNAQCV0 3PEYx4iCXMFQo82EsosrNFMoxeXCv6OMMO+2KyjbzS0O9yk579U3sK9xUNyg== 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=fm2; t= 1737071050; x=1737157450; bh=G/EIJ+XZP5dgGm+wjnGPtupcYepJhWj5R64 p76nFaKM=; b=W858215PDYxykvDn+n6vpgr50hCeQl7A75hbionqz7G968qWE/A K3fGM+WQ1RTTru6TjLKfYPoQUbDGRl/JWvq59ofHud5UC0OuMoEWQFKK3Jw0UREc 29MYvkeG4m2T5iDwmlNWOcCtNPszDcELtHQonuWWhituij2B2i6PN2SnEM/9l/8w hayAq3wmehHHDZWLsHeaUMijRLaBbJpCMDzviGxTMpzKtSfwJlK5FN9QgrlqUKzj stnes4O4mOb3jwvLWddkw++gYyZDC9ilYX5sEm89VggmUh1D+EfHFMmgsBTWAb5a 6igEhH6snzh7o0+hVBh7YpUPevEbOsfEHpA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeivddgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnegfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhf gggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruc eomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteel ieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhes phgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtoheprghnughrvghssegrnhgrrhgriigvlhdruggvpdhrtghpthhtohep sggvrhhtrhgrnhguughrohhuvhhothdrphhgsehgmhgrihhlrdgtohhmpdhrtghpthhtoh epphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Jan 2025 18:44:08 -0500 (EST) Date: Fri, 17 Jan 2025 08:43:57 +0900 From: Michael Paquier To: Andres Freund Cc: Bertrand Drouvot , pgsql-hackers@lists.postgresql.org Subject: Re: per backend WAL statistics Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KM9zLq0PTMCXY9oZ" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --KM9zLq0PTMCXY9oZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 16, 2025 at 12:44:20PM -0500, Andres Freund wrote: > On 2025-01-16 17:11:09 +0000, Bertrand Drouvot wrote: >> So, do you think that the initial proposal that has been made here (See = R1. in >> [2]) i.e make use of a new PendingBackendWalStats variable: >=20 > Well, I think this first needs be fixed for for the IO stats change made = in >=20 > Once we have a pattern to model after, we can apply the same scheme here. Okay, thanks for the input. I was not sure what you intended originally with all this part of the backend code, and how much would be acceptable. The line is clear now. >> 0003 does not rely on pgstat_prep_backend_pending() for its pending stat= istics >> but on a new PendingBackendWalStats variable. The reason is that the pen= ding wal >> statistics are incremented in a critical section (see XLogWrite(), and so >> a call to pgstat_prep_pending_entry() could trigger a failed assertion: >> MemoryContextAllocZero()->"CritSectionCount =3D=3D 0 || (context)->allow= InCritSection" >> " >>=20 >> and implemented up to v4 is a viable approach? >=20 > Yes-ish. I think it would be better to make it slightly more general than > that, handling this for all types of backend stats, not just for WAL. Agreed to use the same concept for all these parts of the backend stats kind rather than two of them. Will send a reply on the original backend I/O thread as well. -- Michael --KM9zLq0PTMCXY9oZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmeJmb0ACgkQnvQgOdby QH2myBAAjhaSA5ifJsVhmJlz61NcOM1JX/SHSwtHjxmsmsyRqVlBDDaFR8BS2jEq ScCLkelnZBJ8s5DN8zpRPHsvxT6qEt5KqOuDle2xhEYPcFUru4SOE3U53Whi2Cxh 1btVCa9fddVf1mxO92R9Z3djzOqncGfmBmDutGdFh8tL1vH7nG/0mTBuKAv8G2vI zI6RUKfX1Vk5TpkAepy/mp4JEkzV9zhKMXIWpSDpdTiQLm+acCK8XAjdon++SHI4 HfV7CACw94TmFmL40v7bwrro5Uu1Dew2V2Dp1mdrhH5WAdYVEDKnDxu6lWp7oXZE 84JK+m4eHfMUGh6SGv3N3HvvwKffwzOemtMwx61hUOltB3dc74oJmxvlz/Qo67dX Z9aORHlvv0QeoHN2cgLyE/9pzSBCaT75RQSByq46QCzZ1zhYb9xVLrIzK6qoKtrt MdqnbNUYwhyjrYAqljUQI24svJW/N+0P1JQ7CqDkLgo9OzgdYkY13VpkG/mZejcO E21cR8b/RRxiyr4KxU6hyaUVd0ZYjDi/20kd/cYzTbe9KKgcCdzohmbfVXgorRgD KQo2lIF1os90DmaB01DxtrWvP7y7amb+16p47kL60njyca2U9VBCC0uDg4KV4bfd uM+WgZh0ykGWMTS5PhxjjmyhUZlZ5L0Qb40jdywudFTLpI7oMgk= =Lqmy -----END PGP SIGNATURE----- --KM9zLq0PTMCXY9oZ--