Re: Patch to remove/report orphaned 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: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Patch to remove/report orphaned files
Date: 2001-05-25 13:04:09
Message-ID: 200105251304.f4PD49u00975@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > This patch removes old sort files on postmaster startup, and reports
> > orphaned database directory files during database vacuum.
>
> I like the first part, but not the second. To name just one problem,
> it will go berserk after OID wraparound. The "minimum startup OID"

I don't see a problem with oid wraparound. The code GetMinStartupOid()
initializes with the current oid:

+ min_oid = ShmemVariableCache->nextOid;

The only issue with oid wraparound is that it will not report orphaned
files from the last vacuum to the wraparound time, which seems OK.

> approach would be ugly even if it weren't fundamentally broken.

I don't see why it is broken.

> That O(N^2) search will get a tad tedious with a lot of tables, too.

Yes, I was going to add a comment about that. Is there a better way, or
should I run some timing tests on a very large number of tables to see
if the loop is significant compared to the total vacuum time?

> I really don't think we have a problem that needs fixing in this area;
> surely not a problem bad enough to justify a band-aid as ugly as this.

Sorry, I don't see it as that ugly. It was the only way I could think
of.

We don't know problems we have with orphaned files because we don't
detect them now. We know we have left over sort files because people
complain about them, so odds are we have these others out there too.
Seems we at least have to have some way of detecting them.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2001-05-25 14:06:36 Re: Patch to remove/report orphaned files
Previous Message Tom Lane 2001-05-25 05:37:56 Re: Patch to remove/report orphaned files