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 1s73Dx-003K2J-9c for pgsql-hackers@arkaria.postgresql.org; Wed, 15 May 2024 01:14:31 +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 1s73Dx-005y4V-C8 for pgsql-hackers@arkaria.postgresql.org; Wed, 15 May 2024 01:14:29 +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 1s73Dw-005y4N-1W for pgsql-hackers@lists.postgresql.org; Wed, 15 May 2024 01:14:29 +0000 Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s73Dt-000FdW-7P for pgsql-hackers@lists.postgresql.org; Wed, 15 May 2024 01:14:26 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 9C7B4114013C; Tue, 14 May 2024 21:14:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 14 May 2024 21:14:24 -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=fm3; t=1715735664; x=1715822064; bh=r8oXpJMWGs i/JWTb6iZZ+qX3PxJLxKZQ4MYL5DouSlI=; b=Bw/vCmthoh1fz9JdevzG+TkIV0 LzDKvrPSGR+o/pYxRaFUb1drgNj6j2QUNr6gZ0KgOks52ABQSGnbJGFH1eNBOiRG 4urOODkmZQXAku7eKAgpjnOFjKstSrBre8/nAW9Bwe4AEWnen2isXVf/gEZnzg7W Id0cnXKUwzAVGuLSZHLvoUgk3R2L+YIfHBKjgoYl8alYZ6F5eFynKTX9D3KKzdgg HlJWlegKwcb77d+eRMGTS6ucaqt9+gIvhpBnffcJ/5mOiT8hVxKWcybFOaInWxbr LYLt6dNbgA97wVhHpBUHEpyDQZRo3/beH3tIsJ2/c3Y+1miB1mHyL0D2CBaA== 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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1715735664; x=1715822064; bh=r8oXpJMWGsi/JWTb6iZZ+qX3PxJL xKZQ4MYL5DouSlI=; b=SM/MP6cqxKpB35LthMIo3c1kKNqwAqUvXvPKXYGYcb6b qdMrxkfsyBCuode7o9cVh9yFD3aNE+C14pVNWZuxi0fvlcF6lwZJiu/qxCTj2FeE K32aMXHyoL6PCmJolJeacD3L02ro+ioIN6hCoCDjT93o2iRLyYCdYTFzbeDdbR5l F8cYHd2AaQjzGvY2IesH8bjzIMoV5Ceuo8OKSHdiljB3wtYhhFIuEZrkk73xA874 ymPMbrkoG3cKvzzcUG/bj4tIEz2+dJTfracz5nMHWjJj4PHReELDtorWtImlvmue Bu3hICPeIKUbde9wJRf0IylILq3k1lr+txLngHBKMg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdegjedggeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghq uhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvg hrnhepteelieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdej necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitg hhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 May 2024 21:14:22 -0400 (EDT) Date: Wed, 15 May 2024 10:14:09 +0900 From: Michael Paquier To: Bertrand Drouvot Cc: Alexander Lakhin , pgsql-hackers@lists.postgresql.org Subject: Re: Avoid orphaned objects dependencies, take 3 Message-ID: References: <62310067-6dc4-97ab-6724-7d3602b5056d@gmail.com> <403075e1-4d60-09e2-a06a-749cd9d88f66@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4r2nQsEFhQdabiBd" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --4r2nQsEFhQdabiBd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 09, 2024 at 12:20:51PM +0000, Bertrand Drouvot wrote: > Oh I see, your test updates an existing dependency. v4 took care about br= and new=20 > dependencies creation (recordMultipleDependencies()) but forgot to take c= are > about changing an existing dependency (which is done in another code path: > changeDependencyFor()). >=20 > Please find attached v5 that adds: >=20 > - a call to the new depLockAndCheckObject() function in changeDependencyF= or(). > - a test when altering an existing dependency. >=20 > With v5 applied, I don't see the issue anymore. + if (object_description) + ereport(ERROR, errmsg("%s does not exist", object_descript= ion)); + else + ereport(ERROR, errmsg("a dependent object does not ex This generates an internal error code. Is that intended? --- /dev/null +++ b/src/test/modules/test_dependencies_locks/specs/test_dependencies_lock= s.spec=20 This introduces a module with only one single spec. I could get behind an extra module if splitting the tests into more specs makes sense or if there is a restriction on installcheck. However, for=20 one spec file filed with a bunch of objects, and note that I'm OK to let this single spec grow more for this range of tests, it seems to me that this would be better under src/test/isolation/. + if (use_dirty_snapshot) + { + InitDirtySnapshot(DirtySnapshot); + snapshot =3D &DirtySnapshot; + } + else + snapshot =3D NULL; I'm wondering if Robert has a comment about that. It looks backwards in a world where we try to encourage MVCC snapshots for catalog scans (aka 568d4138c646), especially for the part related to dependency.c and ObjectAddresses. -- Michael --4r2nQsEFhQdabiBd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmZEDGEACgkQnvQgOdby QH19URAAkn7ldXAbhI2N0VAC1Xy04k+C1OSBMXKTKcJFkFv26V/qqRbPIZEuF5gb R5BiHqbZAPitj69W+ikWlW9aJZUt93+nBq0PIX5a1N9rZy4BiQZzL26Afg1ktXwt CfbVmvyvcNyKBD8gxtISGcTxFf1wF0XXGS1Hug9DMtJLUMNkGdtKvb/QDHkVw0Op cM9MdF5MF3+yseRnvq3x+ZjOzzbD791OYr8w0GdqNXvI4qR1bWvTVUgfh2h+7P8R nCVMfYZ/zUV0E4WKPmDcfXDMPvw1NY62AyjOeN88OfcRixMwLfxnctmnOTgJBcfI uX0GnnfmHCkLxExe/bXoPegQIeTcUOlK7cph1Y8VQ20d+iWLfFiY31cC4Lgr82P0 46uD8NFoRmUmq6Wt0k9NLC9kjGfHSN6iQKyLOtXlBcLOxFAMzBMloi+BetNCijGJ rnMyyaA9dgQommEjbdZaZHjFMFL8MhBmc/HHoZye0pG2AipKQOHTWmkJc87LEkjy veEEn9scxmutF5Dj1cbLehOFFqUzs0IxBIYt9kQFNOctpz6qOyFtlB1fvNzAEepX VWYyiZVMht3elfZpSCF7f5uh62HRGdZz6OCns0EG6jFxMLYwDoVelRB9gVakBM1l hnrixUAc7eDpb5pTnBolKJB95+SROj8t0kfLEdxod9S+4nbe9dE= =mtpW -----END PGP SIGNATURE----- --4r2nQsEFhQdabiBd--