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 1v3Uvh-00HAqA-1k for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Sep 2025 07:37:45 +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 1v3Uvf-007DpI-10 for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Sep 2025 07:37:43 +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 1v3Uve-007Dp9-N8 for pgsql-hackers@lists.postgresql.org; Tue, 30 Sep 2025 07:37:43 +0000 Received: from fout-b7-smtp.messagingengine.com ([202.12.124.150]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1v3Uvc-000eZE-2t for pgsql-hackers@lists.postgresql.org; Tue, 30 Sep 2025 07:37:42 +0000 Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfout.stl.internal (Postfix) with ESMTP id 0066B1D000B3; Tue, 30 Sep 2025 03:37:40 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Tue, 30 Sep 2025 03:37:41 -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=1759217860; x=1759304260; bh=APEDiKeDiu e7OlaLgQAb+S/KZtxzcQFbiG91obtTJVE=; b=Vi6zvRM7nC4YsNW1Faju2sPQst 7KJN8qsdl7+faYcJg/OdTZg5vh/wmEmKH3uFqeGm5Kv5O0bKa0Hn0sEsLU8h01va 63aXYFE0SXN4rJTZ+gv4cVACrKFO0wSLixaxc2WyJFN7zbvd+fW0p4Z0C/KWCwGo 75RJiHsxUW6BkXLTvJ1JAds4OdcsEgmLn2c/kMeQX7cetAhHqx4Puv2IMjfO4wI7 q7rKAlRnn5eLmjmlOnp+SX4VLhYFw7GY6M5HJu4rwJBw/IyfpPfBKeSvoDYbbcBd StbfuVTzRdkzWo7w7LrIgR65N1fo7YsGCKuKWxFTKAfODmPmgd+gRSKqRCMw== 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= 1759217860; x=1759304260; bh=APEDiKeDiue7OlaLgQAb+S/KZtxzcQFbiG9 1obtTJVE=; b=kKq4tZ//cC1eNrTYmvrHbQlVN6A2TgB+/UDfdmst2Q5XnNLU6lG 4ZXSgJCSpE49vvyzb6triQXpoz/7bsBuhfKQoatvuB75kkyMKanlbcIWfBFHwuZT wYrIW1WeVtE/CvAKOiKry39af+mHteCYOMhvDXGtGXyYIxaRW4dLuXA0QFqTa+OZ Itoai8tVaqcc+dRHq7Jq1FKN4HO8X36uPo8e3+Wkkol/oh9Z/7v5YyQs5afgHiOh 0FqJ03NtNMkPBcQMVec/9qW8uVE1nQDEf2VMEghbH0E537CX6IgLY1TJl53x0GVi EjXudGZFfANMh+9okB46XUaTCIE+p5JdBFg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdektddvkecutefuodetggdotefrod 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 03:37:39 -0400 (EDT) Date: Tue, 30 Sep 2025 16:37:25 +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="JfsRm2g0NvaVJqOe" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --JfsRm2g0NvaVJqOe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 30, 2025 at 07:14:14AM +0000, Bertrand Drouvot wrote: > On Thu, Feb 27, 2025 at 12:09:46PM +0900, Michael Paquier wrote: >> 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. >=20 > One option could be to use 2 pending lists for the variables stats and 2 = flush > callbacks for fixed stats. Thoughts? Hmm. I would have thought first about one pending area, and two callbacks for the variable-sized stats, called with a different timing because the stats to be flushed are the same aren't they? For example, if we are in a long analytical query, we would flush the IO stats periodically, reset the pending data, repeat/rinse periodically,=20 and do a last round when we are done with the query in postgres.c. Do we really need a second callback by the way? It could be as well the same flush callback, with an option to mark stats kinds that allow a periodic flush. The trick is knowing where the new reports calls should happen. The executor is the primary target area. 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 -- Michael --JfsRm2g0NvaVJqOe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmjbiLUACgkQnvQgOdby QH0d5RAAj0ibIZ36K5UNPaYoZaNkjjx/5JXWZFK1lDOFRMuQvFIgkhf696nu00tn 1EobZ7hfnisCePlBHeCHP12Lw5BYhXtGU7vu5BhskQrPutY9aeOHW4P9lXaPDgIl pi35qgjnjutM/Hnwz8jxknX/fhvkedJ0AhqaRtGKad6Yb0Y92VNyM/OMQXOTYy8R lcM1yk3yTrLV4Ad5RH69lOGwFE9IG73ckXmY9h1KvlLhNNR/tQOIFjtc5nJrZb4r V+hiNNR/DozqUwmezOz+gd6i7n2ddoZPpxKfOOJtazBc+aGb/M8zDnbfymNHDeQp 525J62wDv5QVxTWJY5ajVnctLfAI5CujpG+CCz8l4vVvNAEeOTW652FY+JCfVUCk nEOW4y9P9kLaJ8W936/RP4W26AR0NPisuy8McSCAgS2KNLl+deLe9Bewa8t7Assp bb27WPP2Wyu050RoDCuOJ1ODcYvi40deZcgI9QZ9qVVdwaR6l4pum5jOFZs9bFs3 Lgp5g6FfiK3Dr/K+Z0AByctLMGPhmXc2nrci6kKn/tQYRnVD0crMCxTt5t+1WdZT aEjrhtftiaNXUspN6ZkgJz1BpWCsxxocIGK/9Cd648ZqpcgRFPlXXBXfHYStERJp q8iMXT5xZufnej2/rPdACLbWgbmw2DwnlUGtjvRPmuA/2vW+oj4= =68XL -----END PGP SIGNATURE----- --JfsRm2g0NvaVJqOe--