Cleaning up unreferenced table files

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Cleaning up unreferenced table files
Дата
Msg-id Pine.OSF.4.61.0503060004140.143050@kosh.hut.fi
обсуждение исходный текст
Ответы Re: Cleaning up unreferenced table files
Список pgsql-patches
Here's a patch for the TODO item "Remove unreferenced table files created by transactions
that were in-progress when the server terminated abruptly."

It adds a new function, CleanupStaleRelFiles, that scans through the data
directory and removes all table files that are not mentioned in pg_class
of the corresponding database. CleanupStaleRelFiles is called after WAL
recovery.

Actually, the patch doesn't currently delete the files, just issues a
warning. Testing is easier if the files don't keep getting deleted :).

The patch also adds a GetTablespacePath function similar to
GetDatabasePath that constructs the path to a tablespace symbolic link.
commands/tablespace.c is modified to use it, in addition to the new
CleanupStaleRelFiles function.

- Heikki

Вложения

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Harmless space allocation typo
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Cleaning up unreferenced table files