Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eM384-0006uG-BU for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Dec 2017 02:38:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eM383-0007k1-OO for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Dec 2017 02:38:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eM383-0007jq-Hv for pgsql-hackers@lists.postgresql.org; Tue, 05 Dec 2017 02:38:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eM380-0003xp-Q9 for pgsql-hackers@lists.postgresql.org; Tue, 05 Dec 2017 02:38:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id vB52cX0I025333; Mon, 4 Dec 2017 21:38:33 -0500 From: Tom Lane To: Michael Paquier cc: Thomas Munro , pgsql-hackers@lists.postgresql.org Subject: Re: Error handling (or lack of it) in RemovePgTempFilesInDir In-reply-to: References: <19907.1512402254@sss.pgh.pa.us> <22163.1512438709@sss.pgh.pa.us> <24313.1512440129@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Tue, 05 Dec 2017 11:30:38 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25331.1512441513.1@sss.pgh.pa.us> Date: Mon, 04 Dec 2017 21:38:33 -0500 Message-ID: <25332.1512441513@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Tue, Dec 5, 2017 at 11:15 AM, Tom Lane wrote: >> 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. > I am getting the feeling that we are going to see people complain > about those files lying around as well... That's as far as my opinion > goes. Perhaps, but surely it's inconsistent to consider that opendir() failure is fatal while failing to unlink individual temp files found by the directory scan is not. As an example, a pretty likely scenario is that somehow a temp directory has been made unwritable by the postmaster. The old coding would have let that pass without even a bleat in the postmaster log; but it results in just the same amount of disk space leakage as ignoring the temp directory because we couldn't opendir() it. regards, tom lane