Re: Temporary tables versus wraparound... again
От | Greg Stark |
---|---|
Тема | Re: Temporary tables versus wraparound... again |
Дата | |
Msg-id | CAM-w4HPCOuJDs4fdkgNdA8FFMeYMULPCAxjPpsOgvCO24KOAVg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Temporary tables versus wraparound... again (Noah Misch <noah@leadboat.com>) |
Ответы |
Re: Temporary tables versus wraparound... again
Re: Temporary tables versus wraparound... again |
Список | pgsql-hackers |
Here's an updated patch. I added some warning messages to autovacuum. One thing I learned trying to debug this situation in production is that it's nigh impossible to find the pid of the session using a temporary schema. The number in the schema refers to the backendId in the sinval stuff for which there's no external way to look up the corresponding pid. It would have been very helpful if autovacuum had just told me which backend pid to kill. I still have the regression test in the patch and as before I think it's probably not worth committing. I'm leaning to reverting that section of the patch before comitting. Incidentally there's still a hole here where a new session can attach to an existing temporary schema where a table was never truncated due to a session dieing abnormally. That new session could be a long-lived session but never use the temporary schema causing the old table to just sit there. Autovacuum has no way to tell it's not actually in use. I tend to think the optimization to defer cleaning the temporary schema until it's used might not really be an optimization. It still needs to be cleaned someday so it's just moving the work around. Just removing that optimization might be the easiest way to close this hole. The only alternative I see is adding a flag to PROC or somewhere where autovacuum can see if the backend has actually initialized the temporary schema yet or not.
Вложения
В списке pgsql-hackers по дате отправления: