pgsql: Fix mdtruncate() to close fd.c handle of deleted segments.

Поиск
Список
Период
Сортировка
От Andres Freund
Тема pgsql: Fix mdtruncate() to close fd.c handle of deleted segments.
Дата
Msg-id E1bi995-0004mc-7T@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix mdtruncate() to close fd.c handle of deleted segments.

mdtruncate() forgot to FileClose() a segment's mdfd_vfd, when deleting
it. That lead to a fd.c handle to a truncated file being kept open until
backend exit.

The issue appears to have been introduced way back in 1a5c450f3024ac5,
before that the handle was closed inside FileUnlink().

The impact of this bug is limited - only VACUUM and ON COMMIT TRUNCATE
for temporary tables, truncate files in place (i.e. TRUNCATE itself is
not affected), and the relation has to be bigger than 1GB. The
consequences of a leaked fd.c handle aren't severe either.

Discussion: <20160908220748.oqh37ukwqqncbl3n@alap3.anarazel.de>
Backpatch: all supported releases

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/f5462dedb70417f57e76b4f90d68d7d099e5b046

Modified Files
--------------
src/backend/storage/smgr/md.c | 1 +
1 file changed, 1 insertion(+)


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: pgsql: Fix mdtruncate() to close fd.c handle of deleted segments.
Следующее
От: Andres Freund
Дата:
Сообщение: pgsql: Fix mdtruncate() to close fd.c handle of deleted segments.