Re: Error handling (or lack of it) in RemovePgTempFilesInDir

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Error handling (or lack of it) in RemovePgTempFilesInDir
Date: 2017-12-05 02:01:30
Message-ID: CAB7nPqT1Ubq2kOHyRhN__ud4t3f57HG1iw4O6W+3USvq5dsjjw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 5, 2017 at 10:51 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
>> On Tue, Dec 5, 2017 at 8:40 AM, Thomas Munro
>> <thomas(dot)munro(at)enterprisedb(dot)com> wrote:
>>> Belatedly, +1. The error hiding seemed a bit odd considering that we
>>> were prepared to log "unexpected file found ...". I probably should
>>> have questioned that instead of extending it monkey-see-monkey-do.
>
>> Well, I am -1 on this change. The coding before commit 561885d that
>> you have now pushed (timezone makes me answer later) was way more
>> conservative and I honestly preferred it as *only* the next postmaster
>> restart would remove remnant temp files which can cause potentially GB
>> of data to stay around.
>
> Uh ... I'm confused? That particular change only concerns whether we emit
> a log message, not whether the action is attempted or succeeds.

From the commit mentioned upthread, this switches one hard failure
when opening pg_tblspc to a LOG report:
@@ -3014,7 +3018,7 @@ RemovePgTempFiles(void)
*/
spc_dir = AllocateDir("pg_tblspc");

- while ((spc_de = ReadDir(spc_dir, "pg_tblspc")) != NULL)
+ while ((spc_de = ReadDirExtended(spc_dir, "pg_tblspc", LOG)) != NULL)
{
ReadDir() issues an ERROR when spc_dir is NULL..
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-12-05 02:05:41 Re: Silly API for do_pg_start_backup()
Previous Message Michael Paquier 2017-12-05 01:54:57 Re: [HACKERS] pow support for pgbench