Re: [PATCHES] Cleaning up unreferenced table files

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Cleaning up unreferenced table files
Date: 2005-05-11 13:19:57
Message-ID: 200505111319.j4BDJvH04879@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Heikki Linnakangas <hlinnaka(at)iki(dot)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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Held 2005-05-11 14:11:06 Re: Oracle Style packages on postgres
Previous Message Bruce Momjian 2005-05-11 13:14:42 Re: Oracle Style packages on postgres

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-05-11 13:53:46 Re: [PATCHES] Where is Translation of "FARSI" FAQ?
Previous Message Alvaro Herrera 2005-05-11 12:45:35 Re: lastval()