RE: Temporary tables prevent autovacuum, leading to XID wraparound
Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
From: "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
To: 'Michael Paquier' <michael.paquier@gmail.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2018-01-25T08:25:34Z
Lists: pgsql-hackers
From: Michael Paquier [mailto:michael.paquier@gmail.com] > On Thu, Jan 25, 2018 at 08:10:00AM +0000, Tsunakawa, Takayuki wrote: > > I understood you suggested a new session which recycle the temp schema > > should erase the zombie metadata of old temp tables or recreate the > > temp schema. That sounds easy. > > If the new session makes use of the same temporary schema where the orphan > table is, cleanup is possible. Now you have a problem if this is not available > as this depends on the backend ID uniquely assigned. Ouch, you're right. If the new session "uses the temp schema," it has a chance to clean the old temp table metadata. However, it won't help if the session doesn't try to use the temp schema by creating a temp table... > It would be better > to just drop the table manually at the end. Just to solve this very incident, it's so. But this is a bug, so we need to fix it somehow. Regards Takayuki Tsunakawa
Commits
-
Clarify comment about assignment and reset of temp namespace ID in MyProc
- 9fc9933695af 11.0 landed
- 1339fcc89617 12.0 landed
-
Make autovacuum more aggressive to remove orphaned temp tables
- 943576bddcb5 11.0 landed
- 246a6c8f7b23 12.0 landed
-
Don't count background workers against a user's connection limit.
- 13752743bf70 9.6.2 cited