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 1vE9k4-006OyV-TT for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Oct 2025 17:13:48 +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 1vE9k3-002Rh3-RF for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Oct 2025 17:13:46 +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 1vE9k3-002Rgv-73 for pgsql-hackers@lists.postgresql.org; Wed, 29 Oct 2025 17:13:46 +0000 Received: from fhigh-a1-smtp.messagingengine.com ([103.168.172.152]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vE9k0-004PzD-1g for pgsql-hackers@postgresql.org; Wed, 29 Oct 2025 17:13:45 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id DA446140020B; Wed, 29 Oct 2025 13:13:43 -0400 (EDT) Received: from phl-imap-03 ([10.202.2.93]) by phl-compute-05.internal (MEProxy); Wed, 29 Oct 2025 13:13:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=compiler.org; h= cc:cc:content-transfer-encoding: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=1761758023; x=1761844423; bh=lrolJQG7ioRErofxCCGqvTon9v/jSmblyqDPYVoCcPA=; b= eXO5qyLrCUMuqjL+g7RCpF8eHf4/gYzMIZehnoLUjbo12yckhJtyw4wks5T3Sf3c +H6g5WVBmUiHiD6H9WknhSXdDnnSSPekxjFBnoGdOXgu1cHubkfBgjQMoBJ1txW8 hdhdse66EEZ0r6+sEdkKqtKrOID8EtL64jjUdO6isbID82WWk5eZwlrblq5ZYSCb YrwmGofF0urwU0ZP7KlMux1j4ga6AFkyYVLsFGlfiWKChtolkpavYPALGH3SeQSo Lywxc/gFgKfCD15tHR847/TxbxKy/U59f7fbFo+QiWib4ZwSxbTqBeKQkwvRFS87 CILpSkXM8X71MZUahdUNWA== 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 :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1761758023; x= 1761844423; bh=lrolJQG7ioRErofxCCGqvTon9v/jSmblyqDPYVoCcPA=; b=c RgwrNbkGU/SyYt3ziIRqksWLknM/ujbRJ5cZ4gRduzuxzi0b0QSUGEdBFkQRoS6k OJcZ1ljM80y0MLVPzwDbX1jmpjpjejYKgA7evm/NSSnPnxYJnWq7rvq4p2OnoOcm 3R2boW2JRxRZIFxd7IBKBMiBCOKhiGWxzu4gLoPLYtdrcP4Cwd7ubfqqBTF6AF8u FLxGMcN7XG+2v288HGcuKIrHhvL7RbKohuMN5NJs+7wOvTjzp7Id7jGbs6ieik32 /uYwGyTVA0WIpBOSK6zTZxXVYgItomh71v1X5SstB3W6qajttBeVrWZLHvpj4DcV PcGNXfbejhoSPyTlG8YZw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdduieegfedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedflfhovghl ucflrggtohgsshhonhdfuceojhhovghlsegtohhmphhilhgvrhdrohhrgheqnecuggftrf grthhtvghrnhepfeehleffgedvleefveetjedtkeetfeeliefhtdduleekieejtdevgfeu veeikeeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epjhhovghlsegtohhmphhilhgvrhdrohhrghdpnhgspghrtghpthhtohepfedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohephhhlihhnnhgrkhgrsehikhhirdhfihdprhgtph htthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrghdprhgt phhtthhopehtghhlsehsshhsrdhpghhhrdhprgdruhhs X-ME-Proxy: Feedback-ID: ic6394509:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 7A88618E0069; Wed, 29 Oct 2025 13:13:43 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: AYKEI1WM5q2o Date: Wed, 29 Oct 2025 18:13:16 +0100 From: "Joel Jacobson" To: "Tom Lane" Cc: "Heikki Linnakangas" , pgsql-hackers Message-Id: <9d93c1ee-5225-44ee-822f-e097190f1ac2@app.fastmail.com> In-Reply-To: <2759499.1761756503@sss.pgh.pa.us> References: <202510221548.tgggefdrlpo3@alvherre.pgsql> <149c402d-54c9-48dd-a730-2f5b958f2129@app.fastmail.com> <769bbdba-f86f-44ad-abad-f6ea4f74e3f2@iki.fi> <2297af80-dd5d-4fcc-815b-75bd64b00bf9@app.fastmail.com> <2759499.1761756503@sss.pgh.pa.us> Subject: Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Oct 29, 2025, at 17:48, Tom Lane wrote: > However ... that won't actually work, the reason being that > asyncQueueProcessPageEntries() doesn't work directly from an SLRU page > but from a local copy. Even if it were to modify the state of that > copy, no other backend would see the effects. > > The reason it's like that is stated in the comments: > > * The current page must have been fetched into page_buffer from shared > * memory. (We could access the page right in shared memory, but that > * would imply holding the SLRU bank lock throughout this routine.) > > The patch proposed here likewise appears to involve holding an SLRU > bank lock throughout what could be a significant number of > TransactionIdDidCommit tests. That seems like it could result in a > pretty bad "burp" in NOTIFY throughput. That problem is ameliorated > by only doing it when VACUUM is trying to advance datfrozenxid, but > still I wonder if we can't find a less concurrency-unfriendly answer. ... > All of this is a problem mainly because of the presumption that > holding an SLRU bank lock for a long time is bad. I wonder how > dangerous that really is. Ops. Sounds scary. I don't know if others have looked at the v12-vacuum_notify_queue_cleanup approach; if it's bad, it would be helpful to understand why. /Joel