Re: wrong fds used for refilenodes after pg_upgrade relfilenode changes Reply-To:

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: wrong fds used for refilenodes after pg_upgrade relfilenode changes Reply-To:
Дата
Msg-id 20220209224230.GS31460@telsasoft.com
обсуждение исходный текст
Ответ на wrong fds used for refilenodes after pg_upgrade relfilenode changes Reply-To:  (Andres Freund <andres@anarazel.de>)
Ответы Re: wrong fds used for refilenodes after pg_upgrade relfilenode changes  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Wed, Feb 09, 2022 at 02:00:04PM -0800, Andres Freund wrote:
> On linux we can do so by a) checking if readlink(/proc/self/fd/$fd) points to
> a filename ending in " (deleted)", b) doing fstat(fd) and checking if st_nlink
> == 0.

You could also stat() the file in proc/self/fd/N and compare st_ino.  It
"looks" like a symlink (in which case that wouldn't work) but it's actually a
Very Special File.  You can even recover deleted, still-opened files that way..

PS. I didn't know pg_upgrade knew about Reply-To ;)



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Aliaksandr Kalenik
Дата:
Сообщение: Re: [PATCH] nodeindexscan with reorder memory leak
Следующее
От: Dong Wook Lee
Дата:
Сообщение: Re: [PATCH] Improve function toast_delete_external (src/backend/access/table/toast_helper.c)