Tom Lane wrote:
> Heikki Linnakangas <hlinnaka@iki.fi> writes:
> > On Tue, 10 May 2005, Bruce Momjian wrote:
> >> The current code is nice and localized and doesn't add any burden on our
> >> existing code, which is already complicated enough. I think we either
> >> fix checkfiles.c, or we remove it and decide it isn't worth checking for
> >> unrefrenced files.
>
> > Let's pull the patch for now.
>
> FWIW, I was OK with the idea of adding something similar to the given
> patch to find out whether we had a problem or not. With sufficient
> evidence that lost files are a big problem, I'd be in favor of a
> mechanism of the kind proposed in Heikki's latest messages. The
> disconnect for me at the moment is that there's no evidence to justify
> that amount of effort/risk. A startup-time patch would have provided
> that evidence, or else have proven that it's not worth spending more
> time on.
Agreed. Imagine a backend creates a table file, then the operating
system crashes. I assume WAL wasn't fsync'ed, so there is no way that
WAL can discover that unreferenced file.
While I think WAL can correct some cases, I don't think it can correct
them all, so it seems it is necessary to check the file system against
pg_class to catch all the cases. The transaction and file system
semantics are just different and need to be checked against each other.
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610)
359-1001+ If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square,
Pennsylvania19073