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 1vW1Eh-00AoNU-2I for pgsql-committers@arkaria.postgresql.org; Wed, 17 Dec 2025 23:47:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vW1Ee-00Gz5D-2E for pgsql-committers@arkaria.postgresql.org; Wed, 17 Dec 2025 23:47:13 +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 1vW1Ed-00Gz54-2L for pgsql-committers@lists.postgresql.org; Wed, 17 Dec 2025 23:47:13 +0000 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vW1Eb-001EcE-36 for pgsql-committers@lists.postgresql.org; Wed, 17 Dec 2025 23:47:11 +0000 Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id 13DAA7A0145; Wed, 17 Dec 2025 18:47:08 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Wed, 17 Dec 2025 18:47:08 -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=fm1; t=1766015227; x=1766101627; bh=jLXsgsAg1P s9Ua3KdpugpsMGbHZ0rukq+3sukZLj2zQ=; b=aVplyjDFEu+e3PSy2CoxL6PS9I 67go8MnJYctTPs++FN8Unf4HkBqKnzBCM06OJFOM5y9w5vIOxPyw/cpHuTCz6QMu wNeoM9zgGAY8anFwArWUMSaCNx4nKQhYKKnnTOj8ICrENZiVVOMjFRCbqgG9BMcT ZaHA3eKGkvRN/VAqXdEnq9ATaaoxFFt6c+rHy+Gj02J1qERD8VWqxHYfWiz929iJ sTkkBokJZMlqi+jsw2atk3enRbWFGBBj4jJlSPVsdniUbgDEzCb1FsRe3O3Z0jLo Gdobb3oGypdCIaDHmQ1f2gpsdcRqsmR6zHhG7F9HgGSVk0lmdRb81pMPlY9w== 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=fm1; t= 1766015227; x=1766101627; bh=jLXsgsAg1Ps9Ua3KdpugpsMGbHZ0rukq+3s ukZLj2zQ=; b=RcN/0Tg+qn7BJ+omW0z+k95XlPGW9+Osh4occc546L5noGqti/h RE8o3PNzKbNvL1r1loldbspXMJKrpnk/iHczcAvYl2fHs+6XQE2DvX/AXX+EEPe5 GidoiTTZRd8jW7CYdKoluWMmfZWlOwW3JPkz4I8t81Xl/26Ld12BXxj8mV0rZGM2 mDch9jYFHt09bPCrDfCmpjk2yI6RvGU1cU2oagWrkCczlCfrO7gDlBSSjdR2YDz/ ks4IgQ608EdlA3ztSRX2D80pe/Xn4gRQKYIoxcbl62RzctqreAbRWX6XndzFCjqv WbpCK07y6ioqe5whwEO2f0ob6BzdyUH9Dbg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdegfeelvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeff hfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehhvghikh hkihdrlhhinhhnrghkrghnghgrshesihhkihdrfhhipdhrtghpthhtohepphhgshhqlhdq tghomhhmihhtthgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 Dec 2025 18:47:06 -0500 (EST) Date: Thu, 18 Dec 2025 08:46:42 +0900 From: Michael Paquier To: Heikki Linnakangas Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Fix remaining race condition with CLOG truncation and LISTEN/NOT Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+XTfq1o401F1Gl87" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --+XTfq1o401F1Gl87 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Heikki, On Wed, Nov 12, 2025 at 07:16:38PM +0000, Heikki Linnakangas wrote: > Fix remaining race condition with CLOG truncation and LISTEN/NOTIFY >=20 > Previous commit fixed a bug where VACUUM would truncate the CLOG > that's still needed to check the commit status of XIDs in the async > notify queue, but as mentioned in the commit message, it wasn't a full > fix. If a backend is executing asyncQueueReadAllNotifications() and > has just made a local copy of an async SLRU page which contains old > XIDs, vacuum can concurrently truncate the CLOG covering those XIDs, > and the backend still gets an error when it calls > TransactionIdDidCommit() on those XIDs in the local copy. This commit > fixes that race condition. >=20 > To fix, hold the SLRU bank lock across the TransactionIdDidCommit() > calls in NOTIFY processing. While reading through this set of changes, the addition of this commit across the v14~v16 range has made me smile: + * Now that we have let go of the SLRU bank lock, send the notifications + * to our backend SLRU bank locks have been introduced in v17 by Alvaro in 53c2a97a9266. Just noticed while going through. -- Michael --+XTfq1o401F1Gl87 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmlDQOIACgkQnvQgOdby QH2LRg//Q6WHfXkoANBsg4dgON5Yqp2RqWjKsuxEIzEBvOJGBjHSZ5o9PHOXcP6T uW+CSsxTTsJ7AFZ9iq3hjhr5WSHIhjJVYrP4aKNa3AxUaT+5iEUj3fSDRmJnNLX9 UqXI8QgP8Zf4I0/pfqMUiPm00V/FL/VSeesGGbXWUYYtN3APZ0Gst3IougHZHkG/ prBMGV1FgVapDiyieqCihtFHWFMdnu+PcikFDDUKNanFSBQ1C2SIs7PleFcRe9fY vrTEQLciA74hXx+A5Ml/Lxwve7d5W0VdZ2qLIf5fY6P5wECXnihWVry0Bf9Fytjo fp98cRW4p8LgjAoQ2VQXehDwtD5q3USMwvDkqAVvv7MfU2GeifH8EOpeHSVrMlps GWhb9Fxfn2DFwNBccEi1kZeEsh1bgdBDVd4DeK51V8Le7ACFPkw61rEQq7RcOYzy lZGtSGR0X6it57UciIlI14XBLCzylOCogmrPJ7g0Ahrge/+c6siCNaKQOJDpmHz7 aqbQnmVmCnGtdaE77kV7HL02OyWRnPWWnOhnFve5JMafGL8cqhs2BmYDga8ZYSnS VybMEX4W1LhjI0erwIAVhfW5p9gEmYG10znE0sqtoPg+lou1kVGwJCk033o8Wk6F cGXS9Aa48uqMUh2/dltJpBguOIFEFHx2MI/y8Qx9bFJ4P1aI2HI= =xCFk -----END PGP SIGNATURE----- --+XTfq1o401F1Gl87--