Orphaned relation files after crash recovery

Поиск
Список
Период
Сортировка
От Masahiko Sawada
Тема Orphaned relation files after crash recovery
Дата
Msg-id CA+fd4k7KHw0E5t9_4LFmsiFYL7SQrtwK312TQQ8q0gUDmy3jkw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Orphaned relation files after crash recovery  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
Hi all,

During testing recovery, I realized that it's possible that a relation
file is orphaned (probably) forever if postgres crashes during
executing a transaction that creates a new relation and loads data.

After postgres crashing, the relation is recovered during crash
recovery and the transaction is regards as aborted, but that relation
file exists in database cluster. There seems no way for postgres to
know that that relation is now garbage and can be deleted. The entry
of that relation in pg_class exists but it is never detected even by
autovacuum because autovacuum's snapshot doesn't include that. In
addition, that relfilenode number is never be reused because the file
already exists. Therefore I think that such orphaned relation file is
left forever. The orphaned relation can be large if we are loading
large data or creating a large materialized view.

Is this a bug? Has this ever been discussed?

Regards,

-- 
Masahiko Sawada            http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Wait event that should be reported while waiting for WALarchiving to finish
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: Orphaned relation files after crash recovery