Re: Unused files in the database directory after crashed VACUUM FULL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Unused files in the database directory after crashed VACUUM FULL
Дата
Msg-id 17143.1549813268@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Unused files in the database directory after crashed VACUUM FULL  (Hannes Erven <hannes@erven.at>)
Ответы Re: Unused files in the database directory after crashed VACUUM FULL  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Re: Unused files in the database directory after crashed VACUUM FULL  (Hannes Erven <hannes@erven.at>)
Список pgsql-general
Hannes Erven <hannes@erven.at> writes:
> I've just had a "VACUUM FULL <table>" crash due to 100% disk usage.
> Clearly my fault, I was expecting the new table to be small enough.

What do you mean by "crash" exactly?  A normal transactional failure
should've cleaned up orphaned files.  I suppose if the kernel decided to
kill -9 the vacuum process, that wouldn't happen --- but that's not
the usual response to out-of-disk-space.

> After freeing up space, restarting the cluster and issuing another 
> VACCUM FULL, I noticed that the cluster was way bigger that it should be.
> In the base/<db>/ folder, there was a large number of files with one 
> certain number that pg_filenode_relation() could not turn into a 
> relation. As that number was just a bit smaller that the 
> pg_relation_filepath() of the table I was working on, I guess these were 
> the remains of the failed VACUUM FULL operation?
> I removed those files and a VACCUM ANALYZE of the whole database went fine.

> So... is this the expected behaviour? Is there a safe procedure how to 
> check/clean up "unnecessary" files in the cluster directory?

You just described it --- verify with pg_filenode_relation that the
file doesn't correspond to any pg_class entry, then manually delete.

(There is a crash-recovery phase that does something similar, but
I think it's only designed to clean up temporary files.)

            regards, tom lane


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

Предыдущее
От: Hannes Erven
Дата:
Сообщение: Unused files in the database directory after crashed VACUUM FULL
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: Unused files in the database directory after crashed VACUUM FULL