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 1tDYAL-001V6S-F7 for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Nov 2024 00:01:53 +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 1tDYAI-000j5Y-VJ for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Nov 2024 00:01:50 +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 1tDYAH-000j55-Eu for pgsql-hackers@lists.postgresql.org; Wed, 20 Nov 2024 00:01:50 +0000 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tDYAE-002mOI-8A for pgsql-hackers@lists.postgresql.org; Wed, 20 Nov 2024 00:01:47 +0000 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 3997513806B2; Tue, 19 Nov 2024 19:01:44 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Tue, 19 Nov 2024 19:01:44 -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=fm3; t=1732060904; x=1732147304; bh=y9UcSEubup CFsB85wbWMMUO5TvS3QsgINJUz3mTiPLM=; b=TRgMqiC4OU3IrKWLNpy/fBwHA8 p+a4xKFPl3UimaBLM2aB/Lk3jQT5j1HR9Z54IjXmrzTXOuc4fvVFCd5vlbHo4qoI VAI2K6+pQjAvwhr3+9vumgFD0FNbDjCAV87bts4xvJyykw7yPYCjRwUSG29VfFE+ 0itfj4peAUsf79bQXclnxPildsMRim4qj3uLoPL36PfymgfSCtmtTcMNwbz6SxZB 6eZYXjf4L8tXjNetVkRZ68mCWPv6AW97Hok3PD6L+rY1ft1WzVdGcAle321XuyWA S3ZJs0nvZ5Es315VW5Ax5KXJtDjps1dFHWLlIb0Si9xmyCCV2NtwHMzR0uxQ== 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= 1732060904; x=1732147304; bh=y9UcSEubupCFsB85wbWMMUO5TvS3QsgINJU z3mTiPLM=; b=cft2Z2UTZDLut6o3BGTWOT+Lvq+W5kFJilYC73BjtbBOkOswuhe IZwzxbCOsSgLlepSPksqHllO+V7x1SYjCK64Fqhis0+t7rw+qrY1P7dH3DgM137S un7f3sxZqiB3TApuYdP7+HwwAYpB8Fh89QuLsFUUNi1seAgf2fiFXzLw3Z7R0UkK 9skbCUO2iMuVS/hJCcwaYvSFpYDCh3sEqTwE8+eN625lkru3qOXmggxnf/UdYOvn lpfI6ftJOzuSvxsz8/UUV58OT7dOxZ825p6OxIZPzEO430I8rzcyUQcwfVfM5oVB 4TLemlqbEQInd1JaZ03ZgE6PDzNFwSZvrUg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrfeefgdduiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenfghrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhgg tggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoe hmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleei fedufffhhfdtteelgeeggeffhfekueevteeigfduudevudetgfegiedvjeenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehp rghquhhivghrrdighiiipdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpohhuth dprhgtphhtthhopegsvghrthhrrghnuggurhhouhhvohhtrdhpghesghhmrghilhdrtgho mhdprhgtphhtthhopegshigrvhhuiiekudesghhmrghilhdrtghomhdprhgtphhtthhope grlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhrtghpthhtohephhhorhhi khihohhtrgdrnhhtthesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrg gtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Nov 2024 19:01:40 -0500 (EST) Date: Wed, 20 Nov 2024 09:01:26 +0900 From: Michael Paquier To: Bertrand Drouvot Cc: Nazir Bilal Yavuz , Alvaro Herrera , Kyotaro Horiguchi , pgsql-hackers@lists.postgresql.org Subject: Re: per backend I/O statistics Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Budt3GbHcMlMO0qC" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Budt3GbHcMlMO0qC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 19, 2024 at 04:28:55PM +0000, Bertrand Drouvot wrote: > So, for the startup process only, what about? >=20 > - don't call pgstat_create_backend_stat() in pgstat_beinit()... > - but call it in StartupXLOG() instead (after the stats are discarded or = restored). >=20 > That way we could get rid of the changes linked to the assertion and stil= l handle > the startup process particular case. Thoughts? Hmm. That may prove to be a good idea in the long-term. The startup process is a specific path kicked in at a very early stage, so it is also a bit weird that we'd try to insert statistics while we are going to reset them anyway a bit later. That may also be relevant for custom statistics, actually, especially if some calls happen in some hook paths taken before the reset is done. This could happen for injection point stats when loading it with shared_preload_libraries,=20 actually, if you load, attach or run a callback at this early stage. The existing sanity checks are a safety net that we should not change or adapt for specific stats kinds conditions, IMO. Perhaps this had better be done as a patch of its own, on top of the rest. > Yeah that's the reason why I suggested "pgstat_backend.c". I would not be > surprised if we add more "per backend" stats (that are not I/O related) i= n the > future as the main machinery would be there. Okay. -- Michael --Budt3GbHcMlMO0qC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmc9JtYACgkQnvQgOdby QH245w/+OgBDvV5VM2wGfl+QuYnF61ZIA9Ych9AlHLi6WqTB/XbkWJCBK6sJoo1s k6qxbW9juvM7NEfI3nbraU+fgPiyPv99DY1MGRn20dzvgaA0aJC0J8dJS1np0Ym7 h8pVJz6RJ6hb96ISQfwmQ8n4ZDNU0df+02Xenu2A1a2U/DHGmkl9YoXyyl02qXn0 miL/XRFaSrKf31SsJg7d/AD/z6DsAjSaXxWbfYyxv3uvzqSdqYJy2HHJCHxDkzoo DyXO5dHCG8+uHLOv7Kaybb8B73oxJ2O3j9R3EVNANGKD24lFHofEC+YZhzFdZ0GG CDeFMdjaGH2kn4aqmIz9dUcTVAXIgn4p1dnb5k8pE31a+LQ9rPY6xC+uUW6Ro8op SnjVM1UozPXL65cT5e81aOaFGUrB9mDzVxLdvpWuMF8kW6tuEkqmhyf6FVSPpdhu 7SVdFCoACZbZKcZ9Kmcakwq1M5Mgnmq8ZQg1OXUm8YoeaKLvNeIHrJvA2+BLIOqp TyhScPwAsKoUfhAhd4AvsWWvY1103qMr8vm3vpbGZLCyZVRdW+SVveRjyVimaqz2 0QERikNWZkVEbhg5Ubp16HPK1TwjUpmFZRIJFMDWt43Z9gD39jXs6J3IIZK6zM/K S+RlQJfp6KgDUXMXrsgF5lDUvxPqU4wBC2KuFcUxUIf3+EQOX8I= =m5en -----END PGP SIGNATURE----- --Budt3GbHcMlMO0qC--