Re: Patch to remove sort files, temp tables, unreferenced files - Mailing list pgsql-patches

From Tom Lane
Subject Re: Patch to remove sort files, temp tables, unreferenced files
Date
Msg-id 21944.991237590@sss.pgh.pa.us
Whole thread Raw
In response to Re: Patch to remove sort files, temp tables, unreferenced files  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Patch to remove sort files, temp tables, unreferenced files  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Patch to remove sort files, temp tables, unreferenced files  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Patch to remove sort files, temp tables, unreferenced files  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> No we don't.  I'm not convinced that we have a problem at all anymore.

> We already know that crashes will leave these files around, and as we
> start using file versioning for CLUSTER and DROP COLUMN, I expect those
> orphaned files to continue.

I don't.  The intention (not yet implemented, but Vadim's referred to it
repeatedly) is that relation file creation/deletion will be logged in
WAL, and so it can be redone or undone after a crash.  That seems a much
more secure approach than anything you've proposed in this thread.

Temp files won't be logged in WAL, but a startup-time cleanup seems
sufficient to deal with them.

> You are correct.  I didn't realized that after I check the shared memory
> for the pid, another backend could start with the pid I was checking and
> create a sort file.  The sort code doesn't do O_EXCL,

... quite deliberately ... you might want to add a comment to that
effect in OpenTemporaryFile.

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Patch to remove sort files, temp tables, unreferenced files
Next
From: Bruce Momjian
Date:
Subject: Re: multi-key GiST patch (please apply to current sources)