Re: Temporary tables prevent autovacuum, leading to XID wraparound
От | Michael Paquier |
---|---|
Тема | Re: Temporary tables prevent autovacuum, leading to XID wraparound |
Дата | |
Msg-id | 20180713042957.GA23895@paquier.xyz обсуждение исходный текст |
Ответ на | RE: Temporary tables prevent autovacuum, leading to XID wraparound ("Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>) |
Ответы |
RE: Temporary tables prevent autovacuum, leading to XID wraparound
|
Список | pgsql-hackers |
On Tue, Mar 13, 2018 at 08:08:48AM +0000, Tsunakawa, Takayuki wrote: > From: Tom Lane [mailto:tgl@sss.pgh.pa.us] >> On the whole, my vote is to fix and apply step 2, and leave it at that. Yeah, I have been thinking about the idea 1 mentioned above, or in short clean up the temporary namespace at connection start instead of first-use of it, and while that would make the cleanup more aggressive, it could be possible as well that only having autovacuum do the work could be enough, so I am +-0 on this idea. > Done. It seems to work well. I have looked at the patch proposed. + /* Does the backend own the temp schema? */ + if (proc->tempNamespaceId != namespaceID) + return false; I have a very hard time believing that this is safe lock-less, and a spin lock would be enough it seems. + /* Is the backend connected to this database? */ + if (proc->databaseId != MyDatabaseId) + return false; Wouldn't it be more interesting to do this cleanup as well if the backend is *not* connected to the database autovacuum'ed? This would make the cleanup more aggresive, which is better. -- Michael
Вложения
В списке pgsql-hackers по дате отправления: