Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iq4Fe-0003PE-Bm for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jan 2020 00:03:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iq4Fb-0000gz-Eg for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jan 2020 00:03:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iq4FZ-0000ee-A0 for pgsql-hackers@lists.postgresql.org; Sat, 11 Jan 2020 00:03:35 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iq4FV-0006wf-Rh for pgsql-hackers@lists.postgresql.org; Sat, 11 Jan 2020 00:03:31 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0B08421C7D; Fri, 10 Jan 2020 19:03:28 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 10 Jan 2020 19:03:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=OPV/QJc+Y60NUQx7P/I2B9JIhTK jV1xAn3P0VyaR+IA=; b=e+HsqDEl7Ft7JM0wtKY9IfM65SSEkLhQOIh33/vHq7p G6dxvab9dPT4x8yFVTmjlKGx5Ub3GfzW+EE4h0vLfwKEn6CdylMSBQEP487LMi/7 lTKvKzj/fGKCcf0/7ImYjYOdoNc8t+m38OHe6Rcr7kkBiarsnU6Ag/Q/R+AOw7t7 sECmeDm+XCe60aJNc2OqBIq/NG96cA7SqV1MP4zyB0jvKooFJQQOV1FXcMvwd4or qOaXvYetf/gKdswYjPyLpo6uPMFA2olRRMLrXay8cT0/9a3cWazz5CRutfAtLgl+ 79LfTzmWRpFpo4Rhy2C9pEVLQBIJZs3/8XIeGjnia3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=OPV/QJ c+Y60NUQx7P/I2B9JIhTKjV1xAn3P0VyaR+IA=; b=H7b0kLu0Zoi+4b1Xl/yv8C 82enMkL81QZYGGOmGLQuY2QSuiE5RCGeS868RbtA7ib83OjOtQ4/7O0TlfzfVL1+ JM47dZyhiaAIjEar0TC4PJGi8ck+ooo5Q+pDQMGY2I3KHlJEfnO6srKcPO/zAS0J UyCrZ6W8jIeFWwJZazAvbXOweIBBq8fhMaDYlk9vpN0jOdSpMYGjvMqvXISqTkLZ 8J3/7MfYidLMkA5knq9vln1pUcb78G3he255Afb+O8wF2mby47wLYlYNkEGDF6kR EVd80shTB7qR2Pgl6eXxRKr3SIX4Bcs2rqouRtde3KSbCULJfEIGiWTfnuOR+zrg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdeigedgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucfkphepudduuddruddtvddrudektddrudekheenucfrrghr rghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 5079730602DE; Fri, 10 Jan 2020 19:03:26 -0500 (EST) Date: Sat, 11 Jan 2020 09:03:23 +0900 From: Michael Paquier To: Tom Lane Cc: Mahendra Singh Thalor , Robert Haas , Kyotaro Horiguchi , PostgreSQL Hackers Subject: Re: Assert failure due to "drop schema pg_temp_3 cascade" for temporary tables and \d+ is not showing any info after drooping temp table schema Message-ID: <20200111000323.GF250447@paquier.xyz> References: <14868.1578420368@sss.pgh.pa.us> <20200108004409.GA3413@paquier.xyz> <5602.1578444917@sss.pgh.pa.us> <20200108015601.GB3413@paquier.xyz> <20200109040612.GG2251@paquier.xyz> <20200110080125.GA250447@paquier.xyz> <20200110110748.GD250447@paquier.xyz> <27335.1578667858@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="FUaywKC54iCcLzqT" Content-Disposition: inline In-Reply-To: <27335.1578667858@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --FUaywKC54iCcLzqT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jan 10, 2020 at 09:50:58AM -0500, Tom Lane wrote: > This doesn't seem like a very good idea to me. Is there any > evidence that it's fixing an actual problem? What if the table > you're skipping is holding back datfrozenxid? That's the point I wanted to make sure: we don't because autovacuum has never actually been able to do that and because the cluster is put in this state by a superuser after issuing DROP SCHEMA on its temporary schema, which allows many fancy things based on the inconsistent state the session is on. Please see see for example REL_10_STABLE where GetTempNamespaceBackendId() would return InvalidBackendId when the namespace does not exist, so the drop is skipped. 246a6c8 (designed to track if a backend slot is using a temp namespace or not, allowing cleanup of orphaned tables if the namespace is around, still not used yet by the session it is assigned to) has changed the logic, accidentally actually, to also allow an orphaned temp table to be dropped even if its namespace does not exist anymore. If we say that it's fine for autovacuum to allow the drop of such inconsistent pg_class entries, then we would need to either remove or relax the assertion in relcache.c:1123 (RelationBuildDesc, should only autovacuum be allowed to do so?) to begin to allow autovacuum to remove temp relations. However, this does not sound like a correct thing to do IMO. So, note that if autovacuum is allowed to do so, you basically defeat partially the purpose of the assertion added by debcec7d in relcache.c. Another thing noticeable is that If autovacuum does the pg_class entry drops, the on-disk files for the temp relations would remain until the cluster is restarted by the way. -- Michael --FUaywKC54iCcLzqT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl4ZEMsACgkQnvQgOdby QH3WGBAAhTVl5FpdIHlRXeNC70sGJmuaDe04uKO/T5tl/NJ/YZqZKqVZt07ZMIHm gNozsGtcPnawvdsC0RivAUn2n2PmcEhM6MO+ivBQmIL2FDpowrATmwBsGejoKRPL vIfZwqpCbjHKXNkWIHTKckukP8GGT/7fJBp7KpzlT+YhT+XFxfvv1bek+vFmQlhB CPtJbrOokanUtFdFNdV+liwuT2Wtl3a1VC7KbUVB1L5gUh8dL59ItVbiH6XVyH7c ZuUCtDN3pkro1kVFC998bJwhf6fRrxoyaibepM8SctO1ZrHsrOx4M47LHq4nxpqc NL3OmEns1l80lVVbFHxF8ikefEYBqLkNQ1fuBw+L4gzn71oR0zK4nfm+eKV7Ac4M uS40mC6wAndBgHM1ZLqcS4BI7xFA7pNpVV/dssblbHmTE2VU2DofuSVOyg/05YzT KqC0YIMCRH5zGFHRVVvgrHHwUBYlg9/jKE965X6O+EFe2X87JqfPB2h0YdKzTx4h 8f7xugtdtZyz0jMXp8Z0zvDOAoHomkXjnQKwRSI8rO7z19wFAe951oOBOVazU5nb FX8JKd0WvmrMOtiRgq3sP2snS7VkadTblhFwa78310ajXQESdjBLifiyMIjQhAVV uMa6rq6d/lL7xe1Htre3FozOi3TQjPJRNP55mE65K/qk+/YC6BE= =ooDV -----END PGP SIGNATURE----- --FUaywKC54iCcLzqT--