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 1waMBZ-001k76-33 for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jun 2026 23:30:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1waMBY-00E2t4-2J for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jun 2026 23:30:12 +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 1waMBY-00E2su-0L for pgsql-hackers@lists.postgresql.org; Thu, 18 Jun 2026 23:30:12 +0000 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1waMBW-000000013Fw-2vPd for pgsql-hackers@postgresql.org; Thu, 18 Jun 2026 23:30:11 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 211FAEC0183; Thu, 18 Jun 2026 19:30:09 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Thu, 18 Jun 2026 19:30:09 -0400 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=1781825409; x=1781911809; bh=H8UfcHJpqY JTTwD6BILekDnkY6lT6BhsWNAyMntLkiA=; b=hXB7krXi11r/sVCjpoOO7731pI SYoJBHLw7M/ooQgZwbkm2ou2SeEefo44Us7xzKY5N2pks2bMY4ym3uebQ30dazm2 Qj6JgbpcsocgoJUXCdF4eoJdrfss8btFkRX9cz7qt5CfmSxySBYOD80OHt1+gLA7 zYRKCXPAQqkBAg2YNKp3g8YKUUcDlvVu6RbDvQBiRqEYIS86ugJ2cpAtye5yTrWf KqkC4NsvGQ5IGFhP6zaLNiuxAoPZpdX6jGjdt6TRhA+7bekXNzayySYUif8/9rHa aQkCMouJQ4V9jLhyDg+CaSOCUkhL0hZnE1HAmmw80/oLTbkz/WfWhhd08GPQ== 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= 1781825409; x=1781911809; bh=H8UfcHJpqYJTTwD6BILekDnkY6lT6BhsWNA yMntLkiA=; b=NIsSe4LtaUrCp8o0S4ILATEF6YJLHQqPPu6Jbd4pmKD9GluKknE C4rRezdC/Kj1uLx25hotvwe7D3Hbi8FotrpLmli/+zpFHrjkV9OMbQAnNMX5Tu4d ik+TOAjOk/8P+pc37b85/CI6VPJOCc7OWSiNWVXP2Hnv9c6nIN/L33JMbctPAmaT u3SDexuNYQhNxDTvI93YSSyzT6TpvHGSgop3/O665P/9SINnH5YO4JM5gWAy0dVX TJiSaDprILSBxk4XQM8kaza24tjZGhqGqthMk2oZWJEQeT9R/byhpJSQiIL36Nhe oyuSj8sJkhBS8u54/V3WiVVuuDsiAzQ85qw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGyROa2V6vSBZppbgbeW70hnaqcDPLzluGq/Bomd169cgwBFuXc0HhWu2NLSxS17d 4BsMYq9pVtt3OTvr4YCPfWefGnsp+Hz26V9SDpIrCQNN9FWFC7SzT1NSUXRnJZMHjQpr/6 JDxiczwnYRP2xpQXTKl1PCMvg3SFz2njnmFhAZI0YbERX+Tj9NJzRNRyjydbpo8/cBp6oQ dnyIuugKX23ukX5dBOoXWNYhW7am32JeLHeoHPRRQZ4MLES5lzWgMo9Q4lb56yDN67JWZk YCx2f9gxwYBhlIQsYru0FRKS5HruDRvufKCxlWzzoEAisP0kG7hb1gSRTCCo8YcnVrJrGM v2+7Ya6rshqrPQS0sc5/Zwhz7SjVjWUrFBFDDxpbJugbV1nJuU/bS4kyX3cfE3FZz0mCGz YwyibBfvN9EiNOKL2ZTFsOBP86A1Bzqnn32m2yUcA3o+i1/n+Nm/4YVCcQMSoI7h2bczBt cLhWPIg9xZg1paecHmlOn8DzmSNafjyCOoHL+uzfarWlxSTJlmLQ+TGS0NADi/lJgP+Ksg nq+7ocCtriQcoXbzGRbnsozpg1y470IoIjl5iPY0dF4bixV95jgTW5SPWKebGKvFWDIljP PsZVZI6P55Z05gcFo4HPXCcyB2/SKl2xGzRk9nde7rvEusR4Dz8quM3R6R9g X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 18 Jun 2026 19:30:05 -0400 (EDT) Date: Fri, 19 Jun 2026 08:29:03 +0900 From: Michael Paquier To: Matthias van de Meent Cc: Heikki Linnakangas , Alexander Lakhin , pgsql-hackers Subject: Re: Unexpected behavior after OOM errors Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tI/sbn7ruSfyyqAD" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --tI/sbn7ruSfyyqAD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 18, 2026 at 05:27:57PM +0200, Matthias van de Meent wrote: > By moving StandbyAcquireAccessExclusiveLock's LockAcquire ahead of > when it links the lock to the transaction, the local data structure > doesn't know to clean up the lock until after it's acquired, so > failure in that process won't make error cleanup try to clean up the > lock. Yep, reordering these two actions would take care of the list inconsistency where the startup process goes down following the ERROR promoted to a FATAL. I have been fingering the idea of backpatching this fix for a few minutes, actually, but discarded the idea at the end. It does not require a random pattern to cause the failure, being actionable through a combination of GUCs as Alexander has proved. Still, the only consequence is an extra LOG entry telling that the lock is not being tracked for non-assert builds. Confusing, OK, but not really critical. Comments? -- Michael --tI/sbn7ruSfyyqAD Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmo0fz8ACgkQnvQgOdby QH3rSg//YS/3dtNFYee9m2HP3pg+KDYV2xB9ZM4225Ln8Ihvwupq6e4a8u7k38nj 2+lABl8L2VQ060EI7fE/4Q0rIs6uxmpb47Tm6kMlX2rk1ljXhF4FBwsfK/8FAKDG BzjmTkF8UBR+y0WbeSwEpGNpG0tRJ4NmZs9LjLXK0aqXc5eH6TuwYufGbRQBcZLZ z7T7vcBAaR172CZa8ORBot7nBdEuLfpIQ1cZGmNRA6mhjw830/6xuIpHmaRyHvbm WHCj/sTsqC+Rh17nn38jqT1b4mgxNabuYp5KR26U75P40ic314xHXRSrTUy3Va2U 4cbx/97oRWx0C1+DqdLgM9huv6pnFCUcYCKU1xK+2+h7D0bDPrYGtfo5BlCVprvs Hzaaksi1Rx86lULQAjroHnSeIuZSwh3lyB3Yt579edQUqs0yUEYoYOEwom8LzZki R06rOGnk5kxygFtBpguemZ3EcG6cHgsKOF2OKKAw46WwYrZUUUAwSSGxMsyAa7TG 9zfWXyUvW2qGTVF06BHAUeNH8Nxt4dxIk7qKLnVUx2iQcGaFcKllnwISLEnUPKKC E09soA17gjdXqFRs+JydRJkwcDr1sohhMmL+tfTe/lMw7meUqQzPAGkTJPRqaex8 3qXaeABjQij4+KwyDKlL/arF2UMeqG3XbM8OB3mEanYyV5yjGmY= =jbFd -----END PGP SIGNATURE----- --tI/sbn7ruSfyyqAD--