Re: Removing pgsql_tmp files - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Removing pgsql_tmp files
Date
Msg-id 1289267707-sup-5839@alvh.no-ip.org
Whole thread Raw
In response to Re: Removing pgsql_tmp files  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Removing pgsql_tmp files  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Excerpts from Tom Lane's message of lun nov 08 22:29:28 -0300 2010:

> Hmm.  If you look at FileClose() in fd.c, you'll discover that that
> "temporary file" log message is emitted immediately before unlink'ing
> the file.  It looks pretty safe ... but, scratching around, I notice
> that there's a CHECK_FOR_INTERRUPTS at the end of ereport().  So a
> cancel that was caught by that exact CHECK_FOR_INTERRUPTS call could
> provoke this symptom.  The window for this is larger than it might seem
> since the CHECK_FOR_INTERRUPTS could be responding to an interrupt that
> came in sometime before that.
>
> I think we need to re-order the operations there to ensure that the
> unlink will still happen if the ereport gets interrupted.

Would it work to put the removal inside a PG_CATCH block?

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-general by date:

Previous
From: Carlos Henrique Reimer
Date:
Subject: Re: Linux x Windows LOCALE/ENCODING compatibility
Next
From: Dave Page
Date:
Subject: Re: One-click Installers for 9.1 Alpha 2 (ETA)