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.96) (envelope-from ) id 1vvS87-002eLr-1K for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 03:33:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvS86-009YJZ-11 for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 03:33:34 +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.96) (envelope-from ) id 1vvS85-009YJP-22 for pgsql-hackers@lists.postgresql.org; Thu, 26 Feb 2026 03:33:34 +0000 Received: from fhigh-a6-smtp.messagingengine.com ([103.168.172.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vvS82-00000001E0d-2DOG for pgsql-hackers@lists.postgresql.org; Thu, 26 Feb 2026 03:33:32 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id 510241400202; Wed, 25 Feb 2026 22:33:30 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Wed, 25 Feb 2026 22:33:30 -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=1772076810; x=1772163210; bh=uwtQ/2H2UO do4prQTwqP5XncyLeN5lExFnyeRfMIBD4=; b=akVwA2FXZjt034I0UP2qwb6oDK /Z/YFeL+qDmQRRIM5rjWJsoQT4d1Huyg+HcnUnO2rht1TidpRDG40iiGbvliQJ+t jzvfye7lrvxvQtww8Gk/6QrMhETB7tBJQuI7XVNpDuJmeIgZXX7UIdXRH2JChsZD cfv0nkCSUzDKP/XDzBhaD11A8yY8nYFT22nRvoum5T1EAfwzcV7MxBGScbM2/vM2 STdVGmP/7LZSsszaT+jQ6vWdY8cYjTaEDO//h/T+7ePq2PiDcohNbJXd7lg3kyx9 y58MSBrDESiWXJvDXP9ZUoMtDPHfD751FN2kelSyj0pofBafPxrrB55vtXvw== 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= 1772076810; x=1772163210; bh=uwtQ/2H2UOdo4prQTwqP5XncyLeN5lExFny eRfMIBD4=; b=SQBcXBTybNbgC5qon3X+DfN5bS0E38J8XejyXEuBcMFqpvazGvy DEgjHu4TExtUkr0XC5CzAskJ1uiRlPDlwny9Ctsu4QYjPXkf9tAmCh615JOJ1P/d n9IiLlTQurxA92ZAKY8D/3gEZw76g2SEdO4uCu/K5vvB2MZMlWZbQs+gCddCjJ/e Vz2QcXFoBcGa56jbWLO9XxFshIOJKL9Niv9r7mirgxZOEQAdxwwk39uoakWFYq+8 flmhlEIIQ2L7SkmaZPaoD/zlywkUHxl862LQsyrWmidiWZPEUX3XiwljOnB4/HAI Mz/q704PdeDBJuTmWs8++0PuM9o5kTpTAQA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvgeegleehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepsggvrh htrhgrnhguughrohhuvhhothdrphhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepshgr mhhimhhsvghihhesghhmrghilhdrtghomhdprhgtphhtthhopehmrghsrghordhfuhhjih hisehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhi shhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepiihsohhlthdrphgrrh hrrghgihesphgvrhgtohhnrgdrtghomh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 25 Feb 2026 22:33:28 -0500 (EST) Date: Thu, 26 Feb 2026 12:33:22 +0900 From: Michael Paquier To: Bertrand Drouvot Cc: Sami Imseih , Fujii Masao , pgsql-hackers@lists.postgresql.org, Zsolt Parragi Subject: Re: Flush some statistics within running transactions Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Y0KBdy3708P7DK9f" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Y0KBdy3708P7DK9f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 24, 2026 at 01:55:48PM +0000, Bertrand Drouvot wrote: > On Tue, Feb 24, 2026 at 08:48:31AM +0900, Michael Paquier wrote: >> I am concerned about the three additional points/requirements: >> 1) The need for all processes who want to flush non-transactional >> stats to set up timeouts, unconditionally, which is what the patch >> shows with the new InitializeTimeouts() calls added for example for >> auxiliary processes. This forces the use of SIGALRM in these >> processes, >=20 > Right but they all already call pqsignal(SIGALRM, SIG_IGN), so I'm not su= re > to get the point. This design requires enabling a new signal with a signal handler in a lot of processes that did not do that. Enabling timeouts in a bunch of new processes, while claiming it is fine to do, sounds like something we should rather be careful about. Are you sure for example that some of the checkpointer code would not buzz on that, for example? At the end, this approach seems too heavy-handed to me. I am also not entirely convinced that enforcing that unconditionally is the right thing to do in some cases, either. For the bgwriter, as one example, we have a WAL report call happening in its main loop, which is quite good in terms of information frequency obtained. Wouldn't some case-by-case strategic "anytime" API flush calls make more sense for some subsystems, rather than relying on a timeout? It seems rather easy to misuse this design in some bgworker contexts, and SIGALRM could also be used for a different purpose but we would block that entirely moving on with future versions? -- Michael --Y0KBdy3708P7DK9f Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmmfvwIACgkQnvQgOdby QH2aqg//Se9YhSvHqGUXKeOB0DcnpPy0ujvtLoiRCvSYtzX3b1BBc6+hbqgs3ykE mWakM1/uJ2XUu+O79XEejMaYEIGgzsNeUyJC6GLXeyqgCbIw/mQ2kdyszczupkw8 XunUtjHUiyou22AHVmp7pkU5ReoUxoW6afKLFwgDiJc7HTvhNAc5N1tL/pxZnY+k T4XDCk/x3Ib5l286To4+0rSAajHvkjulDUQdNd2WNF8LEdrB1kJU3Q8zdhRfma86 PpbvM1GiwsssEIAZWaqZuENc84SiHrA55LTYw01bqHkEQvh/LtKxJ62SGjIOvkJn SsU2qRksMdJu79vw1Gps6uqvIcR1Gsa75laAIT9caVMjwgQ26akipqMiqtn5U967 pnlrFMsGAQC3GUizHWpQ+j/fsy+N600uTjhSyRDN505HBjbbQghl4A93HhwaNjDk gMj211/YHFPU9atptNlKGJUudNiiexY9cBVdr97OjGqh4CbxAzq196ZBliH5Y64M dctLgeuH5YnHEpy/yS7BfcCMSLqOSJGHv2ruGMmm/tDDtlvc2K0wEtZOq5um4jkw cEtZGeyK1eNOGRrWE1y2BwlieZpED84wavb3NseSSSHFXIvBnsLoNgJjCVaNXMQX +9/GZ4BO4F/PTuxULVfagJyXPohlisyu7i+BQuy+k/eOH2TVMWQ= =aA4g -----END PGP SIGNATURE----- --Y0KBdy3708P7DK9f--