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 1vHNEf-005HQQ-Tb for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Nov 2025 14:14:42 +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 1vHNEd-00ERrw-HS for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Nov 2025 14:14:39 +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 1vHNEd-00ERro-61 for pgsql-hackers@lists.postgresql.org; Fri, 07 Nov 2025 14:14:39 +0000 Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vHNEa-006V9T-1b for pgsql-hackers@postgresql.org; Fri, 07 Nov 2025 14:14:38 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 247C3EC01DB; Fri, 7 Nov 2025 09:14:35 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Fri, 07 Nov 2025 09:14:35 -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=1762524875; x= 1762611275; bh=kx557dUM38CMMim3ahvjIsaUcJ5IKkBgr7SVTXnd7ok=; b=p EyozxxXUMgfDY8gQJPwXT7edRdK39q3YCjR4GJTbcOmfrAVb2LtUqmSFA6YuLZ8G 1EC1k80ugScKywxn1uKOoOIGDWKMKDOSR4FHJF0uRhqIUGkd7GLMsJfosLs+/6X/ qWHv/ELJ27NdHrJ25eYKEAnbZAAzUjDvmvEnrRG0SsjmuxNPvgqIlzXLEnoBcCBp byLmoGQlDXFdYos3FrkvyQXJWIwUxCctNTgIvlF3fAnoWOxRXdy+C7h0UhM5nP0P wVl/fN/KDuAEjtZJnMUaTolRuAukBy3KQsvlgfDe50RiU2P7wkSjfqME8q3+mCqq 2Iak3Zjs1VEa79fsIb1Fw== 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=1762524875; x=1762611275; bh=k x557dUM38CMMim3ahvjIsaUcJ5IKkBgr7SVTXnd7ok=; b=TFD2gDSDSsqfKNRtt gCPySneRuHXGzXwhH4W7hzI2/yg41owmiKcJjiAPC0rMTc5u/hprbpaCYWI/HyrP iAoqg7eDzo9FinrgUWegeUb/Db8/T5B8JMAG+4/p7ldRhf5gZQ9h0tvgnU0EOqog WTZDruzfoxXT8BEPY5mEUHbhAvSn2j32tXFaZQvEMcc6gxnnwOQt0Itj+vIkxVjy DvWcQdVs+j480jsy89b+98nQW2ivBJOFpZqMhe6aFB2xf2Nmz5WQDnOJ7j+Gs7FP jugK9INsFH+yghVsR+CGxPeTprPOfbxZnx8lQR8oXCI30aD9gkzaXRKcLBjs9/cq 478+w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddukeelkeekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeeujedvhefhteehgfevhfdvtdevffdtteeuudduheeufffhgedutddt tdffhfefjeenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmpdhkvghrnh gvlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgdpnhgspghrtghpthhtohepie dpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepjhhovghlsegtohhmphhilhgvrhdr ohhrghdprhgtphhtthhopegrrhhsvghnihihrdhmuhhkhhhinhdruggvvhesghhmrghilh drtghomhdprhgtphhtthhopehmrghthhgvuhhsshhsihhlvheljeesghhmrghilhdrtgho mhdprhgtphhtthhopehhlhhinhhnrghkrgesihhkihdrfhhipdhrtghpthhtohepphhgsh hqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepthhg lhesshhsshdrphhghhdrphgrrdhush X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 7 Nov 2025 09:14:34 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1762524871; bh=7R2HdcAsp8EqeZ/m4ic/kSrD7UX5z3mE8IWG8i1PmZM=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=ZB6ZeBeR7ITN/e20ELhIGElJXEMcQdTUasra5s2zvYlqaUPG8XRdUOkV3dynOzoTj JyXZ5FXEvAJd3SqrfLjIF4eq4PTCh+tGawwVPWR/rBghNJBjF8aKs2fwOBJEXpRdbb Hi/oxanJbO47dxRR91qxXvsSg6A7b1PDDPYT+Asr56l6XwcFf/rXjdEzowue9pXvVM DX75gf20IwyUvVUjYzUypZtPYehpPeLB+boBvrEpSvKh1hME8WemshYV5bl8SlgF4r 50MnzYAL2Qvcl0BFSn3vl5htbJ+sF4DJFkudHxNsaXGlPV3BLGoNdeVAzaKC4Xx1AD 1mAYC58957+gQ== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id BC83476; Fri, 07 Nov 2025 16:14:31 +0200 (EET) Date: Fri, 7 Nov 2025 15:14:31 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Heikki Linnakangas Cc: Matheus Alcantara , Arseniy Mukhin , Joel Jacobson , Tom Lane , pgsql-hackers Subject: Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue Message-ID: <202511071410.52ll56eyixx7@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 One thing I noticed while testing this is that asyncQueueAddEntries() fills the end of a page with a dummy entry, when the next notify doesn't fit. However, this dummy entry contains a very valid TransactionId, which the new freezing code will try to look up and freeze. I think this is somewhat bogus -- we shouldn't even try to look up that XID in the first place. I propose to clear it like this @@ -1419,6 +1424,7 @@ asyncQueueAddEntries(ListCell *nextNotify) */ qe.length = QUEUE_PAGESIZE - offset; qe.dboid = InvalidOid; + qe.xid = InvalidTransactionId; qe.data[0] = '\0'; /* empty channel */ qe.data[1] = '\0'; /* empty payload */ } (Line numbers do not match, because I have other local changes.) -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "I'm always right, but sometimes I'm more right than other times." (Linus Torvalds) https://lore.kernel.org/git/Pine.LNX.4.58.0504150753440.7211@ppc970.osdl.org/