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 1v3j4b-002X12-Cw for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Sep 2025 22:43: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 1v3j4X-00D6nc-Kn for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Sep 2025 22:43: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 1v3j4W-00D6nT-Th for pgsql-hackers@lists.postgresql.org; Tue, 30 Sep 2025 22:43:50 +0000 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1v3j4U-000lnj-2r for pgsql-hackers@lists.postgresql.org; Tue, 30 Sep 2025 22:43:48 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 4D39DEC00FB; Tue, 30 Sep 2025 18:43:46 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Tue, 30 Sep 2025 18:43:46 -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=fm2; t=1759272226; x=1759358626; bh=sHqcVU4FLA kLlPl0sBSRH8a8Sb85nmeIFtrwlhVVpOw=; b=TCrZlCMZx26mKRlw6MYdE1UByF QmgOq+Gb9gAROfSaNEc/mrBjA+x2iWmOO2zeOdAxIIgyqPhhUyoh7kSKj3X2or3R JZu5KIwOX2zIlTExielzYmh2T1gBVKsPGnk/iDN7kimian05Yfg/IU8KDKqZQj8T noPOI4pnZddSqKn/gZGnKVcqcnAeoelBLMkMvozsBHHVzyPSROWXnoLiSol/2Ujn O2Qq2W5shjMe3TXeZO8Newmftj0nfIhZ9xa3d7ji8vUDiXmAyWl/2ocCqvvAAGWF xaRoO06VLqJpz8C6h4/Xg1mhJtsUtQl7LYEh64Ezs2MUqIasTzE4x1z1pa4g== 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= 1759272226; x=1759358626; bh=sHqcVU4FLAkLlPl0sBSRH8a8Sb85nmeIFtr wlhVVpOw=; b=nEtNTISYPjYkFqiFRwt5biOzC+br4DqAy3DhTboteRvuj3euu8t KdsIx6vnj6/YZfMbEq2sviUZnl/Dzb6yCRboVjMEtjfrJD4SAr4Vt68SpBbHyE8Q wcVcvyetciaHAf/3PBoahpuIf7Nnh1MWGqMtlr1QzhKBb+QcvdN4myaGOmV1lzvh UAOizOdaZlVN9DxTTrIOgzbhQBgnMp3z7SBK0v1u3DFefwE46GwQy/5jcQqR63TV KOVoeBFoKq2x7yQSpKtJGKO9aWjP8RHzY2yjX05M6KdzrK32BkTojDivTMDqvsSa ypPL5b0P6rYdX6/wyzoaC7K8Pyrn2Nfk6Pw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdekudejudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeff hfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegsvghrth hrrghnuggurhhouhhvohhtrdhpghesghhmrghilhdrtghomhdprhgtphhtthhopegrnhgu rhgvshesrghnrghrrgiivghlrdguvgdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrh hssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 30 Sep 2025 18:43:44 -0400 (EDT) Date: Wed, 1 Oct 2025 07:43:31 +0900 From: Michael Paquier To: Bertrand Drouvot Cc: Andres Freund , pgsql-hackers@lists.postgresql.org Subject: Re: [BUG]: the walsender does not update its IO statistics until it exits Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BTNxzVYKw8PPJGEp" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --BTNxzVYKw8PPJGEp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 30, 2025 at 10:05:43AM +0000, Bertrand Drouvot wrote: > On Tue, Sep 30, 2025 at 04:37:25PM +0900, Michael Paquier wrote: >> Or perhaps you think that the pending data of a stats kind could be >> different if a kind allows transactional and non-transactional >> flushes?=20 >=20 > Yeah that was my thought: one stats kind could have metrics that are tran= sactional > and some metrics that are non-transactional. This could be possible for > both variable and fixed stats, that's why I was thinking about having > 2 pending lists for the variables stats and 2 flush callbacks for fixed s= tats. Okay. The first use case that comes into mind here is pgstat_io.c, to offer periodic reports on analytics (please extend that to the backend stats for WAL and I/O). In this case, it seems that it would be good to know about all the stats fields, meaning that a single pending list is OK. My feeling would be to reuse pgstat_report_stat() and plant a new argument for the transactional state (or just a bits32 that works along the force option) with the same threshold for reports, combined with a new option to allow non-transactional reports (don't see a point in forcing these and wait on locks, 1-min reports not happening would not matter if an analytical query takes a few hours). It would be better to determine a list of the stats we'd be interesting in seeing updated without waiting for a query or a=20 transaction to finish, then design the needs around these requirements, with a new thread to discuss the matter. The IO stats are just the first case coming into mind. -- Michael --BTNxzVYKw8PPJGEp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmjcXRMACgkQnvQgOdby QH054g//X4a9FbUpWRuhN8uN09qaKcZPfA42XiIIeiL0TlTQfMk0PSi2XCg3iKJa 9wb1z7skdjccMj7AXO22lHiN9J5uNtVPnoCaNC3zt9tke8ieS/KMzMyvRDd/U+7u 5gMWn2z7s4idSFWUJ3GlKZIfK6iv7BsBhJz97UWvfAvB3GDAQYFmSjeZKtCUxSOX 5QKI7yN8ZIEKNo4vCI9yzRuUNLrAltF6SdvOd8tTbN4ozUvQRC1VxnTITaD9tN/f 3kS9IIYcfFaVLmxLRWX8M1VM8Y15IB/Tbz/NJDeTQ1lRhxkEWl19YBWJemJyRaIt fGsqN9zKPSvFTIRW7YyYol1R0o1eONy7GAfWusEiWJ9klkFgDVevJkU5dXWlJOWM vU+ZyYXp5OhLhDbIc4J4qLEdifU8YEKRgC5Il0MBGiX1TmePEhQxAgygKvlu6Ozf FtbiSDOcbGOirGwYxuw0GEcAbaDQs54pG0zI2RG6ezEuQ8UPz4/SXhBP7zCKL44I uFHkLXqUgG/80NntdpLEGrsODzSpX760nKIYAK0jfZXaO9MBWb2XVfX5s7jLWiiW UkjedYdkE4O5cQ0kLnGoGkbff40hzJasiZFtPVKuo8lz0KpQZA5z0EmnTLb829mo 7cxy8FAyUTGAnOD+U5TMq3tjz1wDoWdXL++u6+e0MpJeUpeNOzc= =2wEZ -----END PGP SIGNATURE----- --BTNxzVYKw8PPJGEp--