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 1tnUHo-005fNE-30 for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Feb 2025 03:10:08 +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 1tnUHm-003G88-U4 for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Feb 2025 03:10:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tnUHm-003G80-KE for pgsql-hackers@lists.postgresql.org; Thu, 27 Feb 2025 03:10:06 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tnUHj-000JKY-2g for pgsql-hackers@lists.postgresql.org; Thu, 27 Feb 2025 03:10:06 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id 5C8071140D1D; Wed, 26 Feb 2025 22:10:03 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Wed, 26 Feb 2025 22:10:03 -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=fm1; t=1740625803; x=1740712203; bh=ShxM3W83ZR vsCYyCKNSmqkGBybfqcXNQlbeSv7O5Cvg=; b=QGFFU2bMZwRGd/QcfXsBoHxFZi iWZ11lFJUthxAqqZwcbwbOx8dXgg1eXaG3+8C71H0RWnGmi/6PgCKEJBB2YHcBXb eKbIv3mkbMoHWyqeAGOP0dT4fiLit6kWYyDyU57FtHKu+8wDHbGUguQSLMP/x0Hs bORfVH5gLof3TiDfNct4r1Uz1ZGxQ1Ilcfvg8qikkYDgdNhDjxY3Xdr8isdb1Z91 crmlNZn82LXpvfTCQQ2ZKME9xAlpsMds7LH9ldyIMZz6HJjsYg4KY3r3wWGfIcRR VPNEYd1+yRwI62zat/xhtA1gy192zQ3E/qt8qJ3Uy/rWxq/o72VXNYtAgEpg== 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=fm1; t= 1740625803; x=1740712203; bh=ShxM3W83ZRvsCYyCKNSmqkGBybfqcXNQlbe Sv7O5Cvg=; b=R1upzqjnT47payBht0GInCM9htsWwFmiqPBQqonies1GGEDJIsQ KEvio8/s5VJv8VvaNYRSbWy8nd/TXobAjV8Dzfw8qL8AjhO9MluBxyUgi8Rm1GnY yCl5KyChqBrpmyDPxjIxd7lTFxfsHe4puuj1ykDfqSKgoRpLH0M7edWgSD3JLQh8 RpTrGnxb4Y5rjnuROE5vh8CDMa/KOEciNrZInXOGl6DiWdsof7OmJ1t0h6fhZ3Uw AbwfmzLTdYWs+yphhl9QxLHXRaxjODtmAopukMkiksmvzd72I+4Kl5kWO5uilFHe Ofido8wdExLQf3rOTboH+PFR02zg7E6MLUg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekieefiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenfghrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffk fhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrh cuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeet leeifedufffhhfdtteelgeeggeffhfekueevteeigfduudevudetgfegiedvjeenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghl sehprghquhhivghrrdighiiipdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopegrnhgurhgvshesrghnrghrrgiivghlrdguvgdprhgtphhtthho pegsvghrthhrrghnuggurhhouhhvohhtrdhpghesghhmrghilhdrtghomhdprhgtphhtth hopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhr gh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Feb 2025 22:10:01 -0500 (EST) Date: Thu, 27 Feb 2025 12:09:46 +0900 From: Michael Paquier To: Andres Freund Cc: Bertrand Drouvot , 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="WKE5UFSrm2vbNLTB" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --WKE5UFSrm2vbNLTB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 26, 2025 at 05:08:17AM -0500, Andres Freund wrote: > I think it's also bad that we don't have a solution for 1), even just for > normal connections. If a backend causes a lot of IO we might want to know > about that long before the longrunning transaction commits. >=20 > I suspect the right design here would be to have a generalized form of the > timeout mechanism we have for 2). >=20 > For that we'd need to make sure that pgstat_report_stat() can be safely c= alled > inside a transaction. The second part would be to redesign the > IdleStatsUpdateTimeoutPending mechanism so it is triggered independent of > idleness, without introducing unacceptable overhead - I think that's doab= le. Agreed that something in the lines of non-transaction update of the entries could be adapted in some cases, so +1 for the idea. I suspect that there would be cases where a single stats kind should be able to handle both transactional and non-transactional flush cases. Splitting that across two stats kinds would lead to a lot of duplication. -- Michael --WKE5UFSrm2vbNLTB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAme/13oACgkQnvQgOdby QH0oPQ/8CL1rtwNTtMpjfFT8xzqroJE8uldpOpWF37tDZevF3NvY99QCjsXbwgLe Vwy9zdvcdRjgNmjKn1bWzJcDoHIO6ipRmxTRGnfh1sCEzzd8fFoN8QobJE2STTd4 GD73uw2NEvsIg6aLuMs+D1b8NPtfLMXULE/8BxWN3leJbO9755uOoQcoZxLl6Pzb 1Sw+A6s55JrkU4/uScV9UGqC/YBRt+MJuI0dmPuKaKayGIFTa8OKKedvN04mhscD y5d5kXSJFkzkiZkJBxnm65zfVnR812INpW+hJ3uo6sfd+A5yNNnIu5WKMKa9ha9G 56AlBOTEYr8rXJT72LJLsXaNsgW7PkjZkCPPOxzmfoTSqyiayFhS0IU+k24nkkvq OOUQfhQMiKlK5tcn69sGEobCrOwsa+USnTXVffbS9WpSfBX+IzUD2Pl0AAgsNNPT iGvIuz8r+WUwiKRLxbb8BKY3y3A7t3N0gMajbwRRQ3ZwEnyfnDMlJeUP3l3PzP/N jLPks+6G8bcgVOZUQib2uUFcdo4lTLeoQVw6+Ooc7Yr8mPg5WCGBJct2w7j3XZSM zk07K62F8fjbjfsLogjdp+YNUZYd//nSmvG8lilULI/ncsguSn4LkWOFjfx9oqiZ eAZcpNLJOZLIoqMv5IoJt/Uvi+AuWTDEq3viAEdaT46zK7KWGTw= =oWGV -----END PGP SIGNATURE----- --WKE5UFSrm2vbNLTB--