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

Reply via email to