Re: Removing unreferenced files - Mailing list pgsql-hackers

From Alex Shulgin
Subject Re: Removing unreferenced files
Date
Msg-id 87lhn8monv.fsf@commandprompt.com
Whole thread Raw
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>
> Here is a cleaned-up version of the unreference file patch that was
> discussed extensively in May of 2005.  I want to get it into the
> archives in case someone else want to work on it.
>
> Here is a reference to the work still needed on the patch:
>
>     http://archives.postgresql.org/pgsql-patches/2005-05/msg00024.php

Hello,

This is a TODO item, but I'd like to know if there's general interest in
this feature at the moment.

I think it can be useful in a situation when the DBA knows that the
database was shutdown or crashed during extensive data load and has a
way to proceed without the need to start over with the clean database.
In such a case having a tool to report or remove any stale files makes
perfect sense.

My other concern is that if at some point there is a bug in DROP
TABLE/INDEX that leaves the files it's supposed to remove, we would
likely want to know it.

Regardless of the outcome of this discussion it is interesting to know
if such functionality can only be programmed in backend/startup or
making it a separate tool is feasible (the tool will only run with the
stopped server)?  There was once a tool named pgfsck[1], which was never
updated after 8.2, so the name is already taken...

Yet another point is that one might be interested not only in reporting
stale files, but any *missing* ones too.  Currently, you would only know
if a relation data file is missing when actually trying to read from it
and no attempt is made to verify this on startup.  This might be not a
very useful check since if the file is not missing, but corrupted the
check doesn't buy you much.  (I am likely kicking a dead horse here.)

Thank you.
--
Alex

[1] http://svana.org/kleptog/pgsql/pgfsck.html



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Proposal : REINDEX SCHEMA
Next
From: Andrew Dunstan
Date:
Subject: Re: double counting of lines in psql