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 1qaRn2-009GoI-I1 for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Aug 2023 02:15:40 +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 1qaRn1-005orw-3Q for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Aug 2023 02:15:38 +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 1qaRn0-005orJ-Q4 for pgsql-bugs@lists.postgresql.org; Mon, 28 Aug 2023 02:15:38 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qaRmx-001KSU-Pw for pgsql-bugs@lists.postgresql.org; Mon, 28 Aug 2023 02:15:37 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E7A1A5C003B; Sun, 27 Aug 2023 22:15:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 27 Aug 2023 22:15:34 -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:sender :subject:subject:to:to; s=fm1; t=1693188934; x=1693275334; bh=wL Arzor5bM27IZTyMDyMHm75l2hYoZxJZwWsnXxCYgA=; b=JU2CIEhed8S3+OJHR1 l1ZQ8MjibzjVEDygAgPEoKVA97tZggjJASF+cClFAjUmNuqsiMAT68XcQlACieQ5 hfk5KuE8Xk9TM1tNnNbVhYtEN9xZp04RRfFyqAMiNpVXsPbkMqSBtRz9i4Mx/jAI MdbPFtcxh8boI/Ru/8ebsISHlOb913CHYCGQK2XKeE5DckWGUr94Kw81e8TC35H/ AwyDyF6lS7faHsjfvPBgfMrVW9rH/881Dupk0SgKfi6vmOkDDfTbcNDEUmRwK5Ru kS47J4mjdhkrPkCXJn6+QFyIWqWqzKMCfSinRFzw2FqJQ+1TrHye8HhNQqru9IdA daCQ== 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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1693188934; x=1693275334; bh=wLArzor5bM27I ZTyMDyMHm75l2hYoZxJZwWsnXxCYgA=; b=ezfA3tZ5QqLoSueAtYW8svD2XbKB1 4aw+/qlMANv0eGOaPuVQrcK3lhsKF/lqJ2KDVeQny9affMujc7tz0dYbfOM/EksQ 5HrTfdjDzfQugTqE1YyPwiEsh60iqB6OVB6IeJUC3AKUtvC+KNaq9AhZpmWWMIwA GnOAGXuhCgRLN+3vzsbudtJ/M0DeesOtEx+9HTF32ejRj7DDPzYtRujG6TpWqzeR Oz0M2Sb841NumWKPhY2bH4bBGgrwk4+FjkQop1QN12E2USeo/jY0be00Nj2n+Pdf pTfd0fqLFfpAjvOVflk9pkQIeb8h+idzja6Tqk1EF8E1BRjGEw8ttoh/A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeffedgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 27 Aug 2023 22:15:32 -0400 (EDT) Date: Mon, 28 Aug 2023 11:15:28 +0900 From: Michael Paquier To: Andres Freund Cc: Tom Lane , Wyatt Alt , pgsql-bugs@lists.postgresql.org Subject: Re: cache lookup failed dropping public schema with trgm index Message-ID: References: <20230821223610.glmwmdsv2xofihiu@awork3.anarazel.de> <2983696.1692660439@sss.pgh.pa.us> <20230822184558.4d5tfkiep2akbn24@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wGv/GnRLoPzJ976+" Content-Disposition: inline In-Reply-To: <20230822184558.4d5tfkiep2akbn24@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --wGv/GnRLoPzJ976+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 22, 2023 at 11:45:58AM -0700, Andres Freund wrote: > It's not quite that, I think. Whether it fails or succeeds depends on the > state of the system caches. The dependencies lead to the equivalent of > ALTER OPERATOR FAMILY ... USING ... DROP > being performed, before dropping the index. >=20 > I think there are at least three levels of problems here: >=20 > - I don't think we currently properly force index relcache entries to be > invalidated when the relevant opfamily changes >=20 > - LookupOpclassInfo() doesn't have *any* invalidation support, so even if= we > were to perform invalidation, we'd still return a potentially stale > entry. The function says: >=20 > * Note there is no provision for flushing the cache. This is OK at the > * moment because there is no way to ALTER any interesting properties of = an > * existing opclass --- all you can do is drop it, which will result in > * a useless but harmless dead entry in the cache. >=20 > But that's not true (amymore?), because it does do pg_amproc lookups, a= nd > they *can* change. >=20 > - Minor: Even if you force LookupOpclassInfo() to perform lookups again, = it > doesn't work, because when an amproc entry doesn't exist anymore, the o= ld > value in opcentry->supportProcs[i] survives, because nothing resets it. Another thing: we also need to think harder about RelationReloadIndexInfo() which is the cheap path for cache reload for the index information. This is quite different from rd_options, though, because we are going to need an extra facility to look at the pg_attribute tuples for the indexes to get access to the new option options? We touch that a bit in RelationBuildTupleDesc(), but not in this cheap reload path. This is going to require more infrastructure, at quick glance.. -- Michael --wGv/GnRLoPzJ976+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmTsA0AACgkQnvQgOdby QH0iIxAAiwLrOZh5vCGlQ5BHRaYV1LVhIQQ5EJv7bK9hj2C8RZq01Nzac5tcZjhj j0x3SiysE4BxKwFjkRo69zzS75E/wswNvpzNJMJEsmaNqX1SmCz6+L9EWv5tbhYW GW2548Wu3TfxzrT2izwEFwKXsAjRZ4sEWQU+HdKL/2IBYp/KsI2pjTO70NL3P3nG UBdAtvjnbD0HZ/Lj6bcGAIv0KjCBbGymQVffWO6YJsmIXYMjLvXHXLotAKGeBEVp vPnl4Uc8ou/kjY9BNiGX2WAd6FzGPWdUg2KoWe6oWAhHvEu4ZakNYdyxvEMPE3EP b9iekKH8jd1pivcjV9YBTjQbxOCCQcdwQeZ8wCrFNiXQPbr/gjcJGcThO5Qnv525 ZNepUwdLlJR/kwxDD5c+UyUp82vUiV7uzvilnJztXDG9ZEs5tUJPhfEXqlKtkrAc lVr67SYai1pO8dUPeiHaN3IDOBEiq74Dxq3lSrFikcPOvq1EBVOdf8TgLxQn4p4S HQMokfRxkhAeS6JU2PxVOkkbRj/LJsj6RBWbHf9g1SkHxTZbq2+0mptqnRWF7J2t CLCs847eo+GyKteB6Y9t6JNRW3/WW1i8lE7sdtr/Z7CsOKOrv0H5j7IVPaghCJkL raqHx18Y66ob/S+wgPRrAgvP5gLyKReJZAj8G6dlypb3ZvCG3XQ= =vz9E -----END PGP SIGNATURE----- --wGv/GnRLoPzJ976+--