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 1tGtDe-001Yma-BJ for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Nov 2024 05:07:06 +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 1tGtDa-003pzq-9K for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Nov 2024 05:07:03 +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 1tGtDZ-003pzi-NN for pgsql-hackers@lists.postgresql.org; Fri, 29 Nov 2024 05:07:03 +0000 Received: from fhigh-b5-smtp.messagingengine.com ([202.12.124.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGtDT-0006qK-Sx; Fri, 29 Nov 2024 05:07:01 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id 148B625400EE; Fri, 29 Nov 2024 00:06:55 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Fri, 29 Nov 2024 00:06:55 -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=1732856814; x=1732943214; bh=56qexGhioz zsTYojajqllswQM/jsqZqpDKtykAp6M10=; b=PYFBV47uyI4iZi6g/qzxKK+65C ybmg3NUNIo0xbTKeRzmNsixyUI9jMboiXvvvQTG7g5IBY0u6124piGHwCecFNdX9 of2+2Qt8ndaCETbhYUW1elLTX9LUxsPTK5UwlxlFPTxbC733GDtfs69Ex0B7BHlH TFwHuP26wOfGPB1mB2laf+xNOyLebFu+SfBmPPvUyt3LkT09wcWvpvALyJReo42Y KKHadCkJInNRIo4BAXKYl5AAcerFnbrhfCoH2uIOXV4VilDbSJvBKlVIPSGHyiQ6 8XpdZiUFYiT4zfzx6fFXa7EJnTHI3Ld4uKbf78M8AdzqsJ0fL6Vy3Z7ci72Q== 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= 1732856814; x=1732943214; bh=56qexGhiozzsTYojajqllswQM/jsqZqpDKt ykAp6M10=; b=xNQZtaF7ffyN/RfAVzzknf7TkI6cY3QFqs91qxC+bTU62yCjV3s LhXXQXvZ1R9NBAFbJwCnu/zSaO5s7UqNaU+4uYVBmzIrpfYTumHHh5YPKBDyxdcq 3hh5qcOWPRfsOB0Rnz0nhzVPxbzYWLnqyPVLfHj2O5mYCVKKFMA6OCTins4YcBb3 QVhFTQuqnFEZzzfVBog+bkm9P2Vp/nBgqucZ88vuhGswX4LTVSV8r2+IhmxNWKue By23LghVn8OhDH1oPlx5c2jpS/PAJ2ZriyyqE44qMQX6LhpDl4VYdlCA+Sm9AbKb USajV8zVZkn/Z0CsrwCk5UmZ+m/Fn3hS52A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrhedvgdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenfghrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhgg tggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoe hmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleei fedufffhhfdtteelgeeggeffhfekueevteeigfduudevudetgfegiedvjeenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehp rghquhhivghrrdighiiipdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuth dprhgtphhtthhopehmihgthhgrihhlrdhnihhkohhlrggvvhesghhmrghilhdrtghomhdp rhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh dprhgtphhtthhopehnrghthhgrnhesphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthht ohephhhlihhnnhgrkhgrsehikhhirdhfih X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 29 Nov 2024 00:06:53 -0500 (EST) Date: Fri, 29 Nov 2024 14:06:36 +0900 From: Michael Paquier To: Michail Nikolaev Cc: PostgreSQL Hackers , nathan@postgresql.org, Heikki Linnakangas Subject: Re: Strange assertion in procarray.c Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+YnPvJhoyyjhkbM0" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --+YnPvJhoyyjhkbM0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 28, 2024 at 09:04:36PM +0100, Michail Nikolaev wrote: > I discovered that a similar issue was previously addressed by Heikki in > commit [0], where installcheck was disabled for injection point tests. > However, in the meson build configuration, this was only applied to > regression tests - the isolation and TAP tests are still running during > installcheck. I fail to see how this is related? The original issue was that this was impossible to run safely concurrently, but now we have the facilities able to do so. There are a few cases where using a wait point has limits, for example outside a transaction context for some of the processes, but that has not really been an issue up to now. > As demonstrated in the previously shared reproducer [1], even *local* > injection points can cause backend crashes through unexpected side effect= s. > Therefore, I propose extending the installcheck disable to cover both TAP > and isolation tests as well. >=20 > I've attached a patch implementing these changes. @@ -426,6 +427,7 @@ InvalidateCatalogSnapshot(void) pairingheap_remove(&RegisteredSnapshots, &CatalogSnapshot->ph_node= ); CatalogSnapshot =3D NULL; SnapshotResetXmin(); + INJECTION_POINT("invalidate_catalog_snapshot_end"); [...] +step s4_attach_locally { SELECT injection_points_attach('invalidate_catalog_snapshot_end', 'wait'); } [...] #4 0x0000563f09d22f39 in ExceptionalCondition (conditionName=3D0x563f0a072d00=20 "TransactionIdIsValid(proc->xid)", fileName=3D0x563f0a072a4a "procarray.c", lineNumber=3D677) at assert.c:66 #5 0x0000563f096f0684 in ProcArrayEndTransaction (proc=3D0x7fbd4d083ac0, latestXid=3D750) at procarray.c:677 #6 0x0000563f088c54f3 in AbortTransaction () at xact.c:2946 #7 0x0000563f088c758d in AbortCurrentTransactionInternal () at #xact.c:3531 #8 0x0000563f088c72a6 in AbortCurrentTransaction () at xact.c:3449 #9 0x0000563f0979c0f7 in PostgresMain (dbname=3D0x563f0f128100 "isolation_regression", username=3D0x563f0f1280e8 "ioltas") at postgres.c:4524 #10 0x0000563f0978a5e5 in BackendMain (startup_data=3D0x7ffdcf50cfa8 "", startup_data_len=3D4) at backend_startup.c:107 #11 0x0000563f094d8613 in postmaster_child_launch (child_type=3DB_BACKEND, child_slot=3D1, startup_data=3D0x7ffdcf50cfa8 "", startup_data_len=3D4, client_sock=3D0x7ffdcf50cfe0)=20 Isn't that pointing to an actual bug with serializable transactions? What you are telling here is that there is a race condition where it is possible to trigger an assertion failure when finishing a session while another one is waiting on an invalidation, if there's in the mix a read/write dependency error. Disabling the test hides the problem, it does not fix it. And we should do the latter, not the former. -- Michael --+YnPvJhoyyjhkbM0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmdJS9wACgkQnvQgOdby QH0YwBAAgTjXuu0VBgjsIMVfH2/bFr1PQdG2c3EvWNllJxDAg+NuzugpMP6z/324 +Epas10bD5jJvPN38HorODbm6/5ip11iW/iQqXCDDhhq5Uc0dRxeHlATdc9Y8ubb mtaoLudD5/33V/72xTDZzMZ2pXx5iUmgcJoZ01vWzsZUKCgGPAgeZxyJphpDOKZC Z3Ds7lIbKeljRy7oUoq+epGquJNgJ9vLmaZN3rGW7BXlD3Lk0j4LxjLZMekfzxu9 JCXpywJmXijsEX1VICRsz4UiEWwoBQzM2g1yzNG9xuxVf2L8wvSByg8vWtlao+gn EtOIj3gL8wtLul02OgJYyDc3RP1AOLKf2hCPleWV2QP2D6DGPzZO03n9S/hgBQiI 1AtmaUf7iQ+udRwKIJoo6+aHMFsVDi9wHzhTjGR8PkFfRAcakB5pHQTAmnY0v+aV KX7tW9eKOdiV1UeJKBfKl8zEbttKrIzDsOPeFFLGXl7fOlJjpNNe1F1/Rr8SDIsu P5/LMAaPJ6B2ouHZeP8EnZ6taSJpwejt7sUSj+t9PYvdtuRjXtWBjsMoKWDwLNlM Wwcp4wVpN2RlDF//ZQnZL3xD6Z8BJhbjNqhkmrYYy22HNZklWKCcKPdvPZy5Etbh Prgnq+3xXaDxE1DFs7dtJFjd0/5w1OORebPWoffOzKOZkJTdDMw= =lVNB -----END PGP SIGNATURE----- --+YnPvJhoyyjhkbM0--