Re: Reviewing temp_tablespaces GUC patch

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: "Jaime Casanova" <systemguards(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Bernd Helmle" <mailings(at)oopsware(dot)de>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Subject: Re: Reviewing temp_tablespaces GUC patch
Date: 2007-05-30 02:10:54
Message-ID: 200705292210.55970.xzilla@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tuesday 29 May 2007 20:06, Jaime Casanova wrote:
> On 5/27/07, Robert Treat <xzilla(at)users(dot)sourceforge(dot)net> wrote:
> > On Friday 25 May 2007 12:39, Jaime Casanova wrote:
> > > On 5/25/07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > > > Bernd Helmle <mailings(at)oopsware(dot)de> writes:
> > > > > --On Freitag, Mai 25, 2007 10:49:29 +0000 Jaime Casanova
> > > > >
> > > > > <systemguards(at)gmail(dot)com> wrote:
> > > > >> No, because the RemovePgTempFiles() call in PostmasterMain() will
> > > > >> remove all tmp files at startup.
> > > >
> > > > I believe we do not call RemovePgTempFiles during a crash recovery
> > > > cycle; this is intentional on the theory that the temp files might
> > > > contain useful debugging clues.
> > >
> > > ah, i forgot that
> > >
> > > > So there is a potential problem there.
> > > > Not sure how important it really is though --- neither crashes nor
> > > > tablespace drops ought to be so common that we need a really nice
> > > > solution.
> > >
> > > the only semi-sane solution i can think of, is to have a superuser
> > > only function that acts as a wrapper for RemovePgTempFiles(), but
> > > still exists a chance for shoot yourself on the foot...
> >
> > If there was a way for DBA's to know they could safely delete the
> > left-over files (maybe the files timestamp is older than postmaster
> > start; though not sure how you measure that), then I think this would be
> > enough to give them a way out. Of course maybe that level of smarts
> > could be put into drop tablespace itself?
>
> i don't think silently delete the files is a good idea, specially if
> the files are left there intencionally...
>
> but what, exactly, we want to do? delete the files or maybe sending an
> HINT just after the error so we can inform the DBA about the temp
> files and let him decide.
>

I guess the thing to do is error that you cannot drop a non-empty tablespace,
with a hint that there are files older than pg start time in the tablespace
directory.

--
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-05-30 02:20:27 Re: TOAST usage setting
Previous Message Wang Haiyong 2007-05-30 00:47:30 Re: Help! DLL make faild under windows mingw.