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 1hZOmQ-0006TQ-3w for pgsql-hackers@arkaria.postgresql.org; Sat, 08 Jun 2019 00:00:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hZOmO-0001RB-HC for pgsql-hackers@arkaria.postgresql.org; Sat, 08 Jun 2019 00:00:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hZOmM-0001R4-Ob for pgsql-hackers@lists.postgresql.org; Sat, 08 Jun 2019 00:00:16 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hZOmD-0006wS-0K for pgsql-hackers@lists.postgresql.org; Sat, 08 Jun 2019 00:00:14 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id EA800222BD; Fri, 7 Jun 2019 20:00:02 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 07 Jun 2019 20:00:02 -0400 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=fm1; bh=S2G75ahzM6GCAGq/Z5D17ov1gNC /wvAt/YSUmbaoOWQ=; b=HYiFCww1WzsCilbwXWGbP8DFk7lT3w7GVUjVxI6KgiH KKsDb6Db4B0+X2Cpbg+P9cPP7gJFLGOOKWeEUu/ZuSgg+O9DUyzZL1wne2UnqCz1 LN5jc6jR9waXKcFNSFczFrtZWWXr3dsOLk6ldir8yS2IwGABQRUNh76gZrmXydYh xYwDLN2/wQW4nDvlsiqyIIxl6b6TnmUjJGysMl+JkR6TK5A4iRg0l5fn0p3RTxSl paPrXruiDjv5dTnGQWJesoV2OUHytmOWyqORbqPotSWAaEXBCbFgltQWkyB0ioIh tEyutrm2m1HKX+DHXXGdDUQAviiBDBp7kwq7zi5ncNg== 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=fm2; bh=S2G75a hzM6GCAGq/Z5D17ov1gNC/wvAt/YSUmbaoOWQ=; b=Irzz9aQs5YtZgTkMcqcYwV c14ukMRKQNM6gt9bJLW7ZyoA2hljyzqXDVhIAHpBrFyEKF0O1CmRx9UZpQY+cOL3 wHjKfYrIgT3xJPRhOm5IxVMEOUOzP1nA3F3AzadvUPFOzq0gdCWZDHKr6fFFWa8O dNhO3BqsjedQKmiNrKeMmtevvv8YHpNs9qrKK0FhXF9vBTfeX+6Vd1M9ZSCs5E0L y31ftOHMwGW3eP5jlBQpyoDYowrXXgD5dSmC9liHGR0WNxHznlIEHUQeI5QxwxoM gzxu4OwJkmhQPlHsshFpqympMfdeFvV1ysGr0cU6BWf4yNKIKacCX3BicgtTqrpA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudegjedgvdejucetufdoteggodetrfdotf 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 E668780061; Fri, 7 Jun 2019 19:59:47 -0400 (EDT) Date: Sat, 8 Jun 2019 08:59:37 +0900 From: Michael Paquier To: Andres Freund Cc: Thierry Husson , Robert Haas , Tom Lane , pgsql-hackers@lists.postgresql.org Subject: Re: Temp table handling after anti-wraparound shutdown (Was: BUG #15840) Message-ID: <20190607235937.GA1590@paquier.xyz> References: <15840-06c9565bfd8099f6@postgresql.org> <20190607190231.6psb6w3bvlod7lvk@alap3.anarazel.de> <20190607145911.Horde.MKizKAnShw4nKEYGDUC2M-T@webmail.iciel.com> <20190607201002.cado5goe3rcup43n@alap3.anarazel.de> <20190607164027.Horde._egTUMJMTDBA4f31sPYgl_J@webmail.iciel.com> <20190607225843.z73jqqyy6hhc6qnp@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline In-Reply-To: <20190607225843.z73jqqyy6hhc6qnp@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 07, 2019 at 03:58:43PM -0700, Andres Freund wrote: > Do we need to move the orphan temp cleanup code into database vacuums or > such? When entering into the vacuum() code path for an autovacuum, only one relation at a time is processed, and we have prior that extra processing related to toast relations when selecting the relations to work on, or potentially delete orphaned temp tables. For a manual vacuum, we finish by deciding which relation to process in get_all_vacuum_rels(), so the localized processing is a bit different than what's done in do_autovacuum() when scanning pg_class for relations.=20 Technically, I think that it would work to give up on the gathering of the orphaned OIDs in a gathering and let them be gathered in the list of items to vacuum, and then put the deletion logic down to vacuum_rel(). However, there is a take: for autovacuum we gather the orphaned entries and the other relations to process, then drop all the orphaned OIDs, and finally vacuum/analyze the entries collected. So if you put the deletion logic down into vacuum_rel() then we won't be able to drop orphaned tables before working on a database, which would be bad if we know about an orphaned set, but autovacuum works for a long time on other legit entries first. -- Michael --6TrnltStXW4iwmi0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlz6+mkACgkQnvQgOdby QH1CLA/+N66h+KwTzNSmcv9ElqqVyLxmAIFO0DpRTUWoSC+T/a72k7wf6omOj+o2 8l5tuuv5N91Wyao9EUbVb6lmYHePw3RQ40c0yz6YdszGUumt9GPXqBo7/D/Twzhe qbmWpwBQQbFwEalZgtW77gRMBnzH+77zVMZUdI87aeT7ET8dEw8YuWGcSnoME0RL Lxdos3/o9Bdqv0+Um/5AnCmENQK1QJPpA47hp9au62o+bPd98hET+dNhi+iNpK4u 7bqhxqLeCR09NHeNZvRLcoo1dFLxZJLmVG80+UO/RZ2qtZc9Af0Mq75LK+xWVlgB C7fW+fhkMiSfMm3O2DQ2BFUEp1Kt/m9txHBtaofhmMljXisyeNJgVD8GDgKXUunh D9ZRM9gksMGe234E+HnUW4nq9ul/trbNjNa7ahveVRW1g+n/lYDiQlVcfhfs3MOv EpbuRSoxo5wpmnieYmPYe64aWJ3Oa53Hmc55Wa/STRTw7vdNXfIjI2vXyquxZfXU 44Ut8NK8DGgmua4cdupML5jFm7XhKykrxKieOx8WWXo2nmhZu/5CtGUp29FY15Cc Z67/fmBbN2y/gFeuOppOm9N6W8fvBbeJVd4dQAPxkiQMvERc1cMMJGc2oXW+S148 6tCpdS1RANST9f6k1Eh1IGCD0MToCuaqMJ7ExLslUjIqIdHKYOo= =5sU6 -----END PGP SIGNATURE----- --6TrnltStXW4iwmi0--