Re: Patch to remove/report orphaned files - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Patch to remove/report orphaned files
Date
Msg-id 200105251304.f4PD49u00975@candle.pha.pa.us
Whole thread Raw
In response to Re: Patch to remove/report orphaned files  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Patch to remove/report orphaned files  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
> Bruce Momjian <pgman@candle.pha.pa.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@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Patch to remove/report orphaned files
Next
From: Tom Lane
Date:
Subject: Re: Patch to remove/report orphaned files