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 1vll51-003cs4-04 for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jan 2026 09:46:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vll4y-004B0D-09 for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jan 2026 09:46:16 +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 1vll4x-004B04-25 for pgsql-hackers@lists.postgresql.org; Fri, 30 Jan 2026 09:46:16 +0000 Received: from fout-b8-smtp.messagingengine.com ([202.12.124.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vll4w-0008lW-05 for pgsql-hackers@lists.postgresql.org; Fri, 30 Jan 2026 09:46:15 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 963F11D00128; Fri, 30 Jan 2026 04:46:13 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Fri, 30 Jan 2026 04:46:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm1; t=1769766373; x= 1769852773; bh=NdRa5eZaw74Q7JKUuD7eN25GPfC3ImJ1uMZGNOTtH6Y=; b=o Ok6j4vN5wI8h89AIhRA4WFJHgaiB8k9kdPZGvE0zNinRpoRzsfK1H8zOqMXxhsqV VBjlM18+LhxbSsXrmGeX/+vi0IT5tLAW0FxhuKC4xuEFUd1TiDRdD2VqZc3WZr+u IdF/zcrDueCFlDvAibe48dr4py3RTW4kQy1tquqpLPzIKOwfrJ+rU55B0iL+AByk I92NMAgsDU7kIpnnfahqW8Z7x2lBZxMnE/zdd+O4+wnwq6+1kgbO+1rHbfQWTGDh O4ft3vc3L3oAFvfChe/QkxO8TPmjeodKrAQFiQibdtpDbibNiVad3xxyTvYTa3cR y8ojqylsLXAgBeqiKS47A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1769766373; x=1769852773; bh=N dRa5eZaw74Q7JKUuD7eN25GPfC3ImJ1uMZGNOTtH6Y=; b=cJAMicr0n6Vd/NXpz j6I+4fIep2HjW3X1NpP7YO9DSSUvHUJdVxdtjoqplc1TBcZEc415yH3IB8jhy1v8 1IobBf1/X7JyUw7aZIFtNvjlea07v6Si9Cv036FnLP0b/oLvW6y6L8YwsF9GSaaQ fZ5TXsAPRVeZYGRXNlji5XbsAOLyzH6LFeQgC0g82cDHAvNP1Z6G6ccj13h5H1OV uyvz0kLBFzWmmh6A0rOnSaD+uLKQWYmDx+nY79gfyAh9lHEVL3boFxXIN/cg8YTs mh1lbiRIiH2phobGZjYDCijwTGEyTO/nISApEnvUYzNXOyn+oHGi8hN3OkGcqAzI UtT7A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduieekjeduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpedvteehvdetiedtuedtgfevfeeikeelleejfefhheeuieettedvieek hfekteekieenucffohhmrghinhepphhoshhtghhrrdgvshdpphhoshhtghhrvghsqhhlrd horhhgpdgvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurd guvgdpnhgspghrtghpthhtohepiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohep sggvrhhtrhgrnhguughrohhuvhhothdrphhgsehgmhgrihhlrdgtohhmpdhrtghpthhtoh epmhgrshgrohdrfhhujhhiihesghhmrghilhdrtghomhdprhgtphhtthhopehsrghmihhm shgvihhhsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsh eslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepmhhitghhrggv lhesphgrqhhuihgvrhdrgiihiidprhgtphhtthhopeiishholhhtrdhprghrrhgrghhise hpvghrtghonhgrrdgtohhm X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 30 Jan 2026 04:46:12 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1769766371; bh=YjOlpKBgcv+kELx2kzGLo3OrhHSHBzWPtu2IyrX+3oU=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=SurTi46gF40VM8XNxhKxE3fDnfDUPLQ66mj3Id2VGgvvR92CvUF0Ks+O//Jr9LBe2 dvZTeXJ1gY9OuQwyePE8OU9U9G4Vea628fwDXQbVaJo7/rxEkAm9tPpr0J+uIvDewC 3TogrZSZDGTNbmPx8ne3MKKLwOsz10W6/Uskkm47q0kEL8+w/i+LCfeNcTPWNM1oUv bPeqNn46xwVu3+tDPCWk3PLwIX+FYl6R04QgK6EZ2SUFuaebQ+Nf1fK70k3oIqUZt7 0/91Nql4+geIQjfTmH5j5sVqxTwET5Im5OL54pumKMYF3mlJ31kUpA2wUgp4ScMLVb 158fs91pCSEnA== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id AB2116A; Fri, 30 Jan 2026 10:46:11 +0100 (CET) Date: Fri, 30 Jan 2026 10:46:11 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Fujii Masao Cc: Bertrand Drouvot , Sami Imseih , Michael Paquier , pgsql-hackers@lists.postgresql.org, Zsolt Parragi Subject: Re: Flush some statistics within running transactions Message-ID: <202601300940.gzzbe57cdvny@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-Jan-22, Fujii Masao wrote: > I haven't read the patch in detail yet, but after applying patch 0001 and > causing a lock wait (for example, using the steps below), I observed that > log_lock_waits messages are emitted every second. Interesting. Bertrand asked me about this. He says[1] he diagnosed this down to SetLatch being called immediately after the handler runs, and I wonder if it's correct that other timeout handler functions used for RegisterTimeout are doing SetLatch(). The SIGALRM handler handle_sig_alarm() that calls the specific handler function already has a SetLatch call, so why do we need another one here? I tested this theory quickly by removing the SetLatch from IdleStatsUpdateTimeoutHandler() and rerunning the tests. (This one chosen because it has highest coverage per [2]). Everything passed, though of course this is probably not proof enough. Maybe we're just cargo-culting these SetLatch() calls? [1] https://postgr.es/m/aXJUK90lKXw3wrZn@ip-10-97-1-34.eu-west-3.compute.internal [2] https://coverage.postgresql.org/src/backend/utils/init/postinit.c.gcov.html -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Right now the sectors on the hard disk run clockwise, but I heard a rumor that you can squeeze 0.2% more throughput by running them counterclockwise. It's worth the effort. Recommended." (Gerry Pourwelle)