Re: Cleaning up unreferenced table files

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Cleaning up unreferenced table files
Date: 2005-05-05 03:25:07
Message-ID: 200505050325.j453P7G12279@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


FYI, his patch is in CVS and now only _reports_ unreferenced files, and
it happens on recovery and normal startup.

---------------------------------------------------------------------------

Simon Riggs wrote:
> Heikki,
>
> Good patch.
>
> ...The patch makes no mention of temporary files, which are left there
> after a crash.
>
> Temp files are only removed on a normal startup, whereas the patch
> invokes removal on both normal startup and crash recovery. That doesn't
> make much sense...
>
> Also, temp file deletion happens in the postmaster, not at the end of
> recovery in xlog.c.
>
> Could we rationalise those two? One place, one action for both?
>
> I'd rather have this also as an administrator command rather than as
> something automatically run after crash recovery. That way I have my
> debugging opportunity, but the admin can remove them without restarting
> the server.
>
> Same code, just a Function instead...
>
> Best Regards, Simon Riggs
>
> reference from fd.c: (this is not a patch)
>
> /*
> * Remove temporary files left over from a prior postmaster session
> *
> * This should be called during postmaster startup. It will forcibly
> * remove any leftover files created by OpenTemporaryFile.
> *
> * NOTE: we could, but don't, call this during a post-backend-crash
> restart
> * cycle. The argument for not doing it is that someone might want to
> examine
> * the temp files for debugging purposes. This does however mean that
> * OpenTemporaryFile had better allow for collision with an existing
> temp
> * file name.
> */
> void
> RemovePgTempFiles(void)
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
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-patches by date

  From Date Subject
Next Message Neil Conway 2005-05-05 03:48:05 make use of ld --as-needed
Previous Message Oliver Jowett 2005-05-04 23:57:08 Re: Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL