From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Error handling (or lack of it) in RemovePgTempFilesInDir
Date: Mon, 04 Dec 2017 21:15:29 -0500
Message-ID: <24313.1512440129@sss.pgh.pa.us> (raw)
In-Reply-To: <CAB7nPqT1Ubq2kOHyRhN__ud4t3f57HG1iw4O6W+3USvq5dsjjw@mail.gmail.com>
References: <19907.1512402254@sss.pgh.pa.us>
<CAEepm=1k1OdQ2LpReSrA1h-NoSgospTQ9Vp4J_RE2aMXwjAS7A@mail.gmail.com>
<CAB7nPqTdmUUSu9AsrAz4fcFUFNAutw2av3EpHmRi7P7jKFf_bQ@mail.gmail.com>
<22163.1512438709@sss.pgh.pa.us>
<CAB7nPqT1Ubq2kOHyRhN__ud4t3f57HG1iw4O6W+3USvq5dsjjw@mail.gmail.com>
Michael Paquier <michael.paquier@gmail.com> writes:
> On Tue, Dec 5, 2017 at 10:51 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 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)
> {
That's not the same commit you just mentioned. The point with this one is
that RemovePgTempFiles is a noncritical operation: if we fail to remove
temp files, it's still safe to start up, because those temp files won't
cause failures later. (This is the exact opposite of the situation for
ResetUnloggedRelations's directory scans, which is why I changed that one
in the opposite direction.)
The general theory I'm operating on is that we should endeavor to
let the database start in any situation where that doesn't involve
a data-corruption hazard. Yeah, it might not be nice if we leave
GB worth of temp files around, but is a postmaster start failure
better? I don't think so.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, michael.paquier@gmail.com, thomas.munro@enterprisedb.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Error handling (or lack of it) in RemovePgTempFilesInDir
In-Reply-To: <24313.1512440129@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox