Re: Cleaning up unreferenced table files - Mailing list pgsql-patches

From Simon Riggs
Subject Re: Cleaning up unreferenced table files
Date
Msg-id 1115189170.4011.191.camel@localhost.localdomain
Whole thread Raw
In response to Re: Cleaning up unreferenced table files  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Cleaning up unreferenced table files  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
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)



pgsql-patches by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: Added columns to pg_stat_activity
Next
From: Oliver Jowett
Date:
Subject: Re: Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL