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

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Error handling (or lack of it) in RemovePgTempFilesInDir
Дата
Msg-id CAB7nPqT1Ubq2kOHyRhN__ud4t3f57HG1iw4O6W+3USvq5dsjjw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Error handling (or lack of it) in RemovePgTempFilesInDir  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Error handling (or lack of it) in RemovePgTempFilesInDir  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, Dec 5, 2017 at 10:51 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Michael Paquier <michael.paquier@gmail.com> writes:
>> On Tue, Dec 5, 2017 at 8:40 AM, Thomas Munro
>> <thomas.munro@enterprisedb.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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] pow support for pgbench
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Silly API for do_pg_start_backup()