Re: Removing pgsql_tmp files
Alvaro Herrera <alvherre@commandprompt.com>
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Glaesemann <michael.glaesemann@myyearbook.com>, pgsql-general <pgsql-general@postgresql.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2010-11-09T01:56:38Z
Lists: pgsql-hackers
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