Re: Cleaning up unreferenced table files

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Cleaning up unreferenced table files
Date: 2005-05-04 06:46:10
Message-ID: 1115189170.4011.191.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Oliver Jowett 2005-05-04 23:57:08 Re: Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Previous Message Tom Lane 2005-05-03 17:39:15 Re: Feature freeze date for 8.1