Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gcKaG-00019x-UH for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Dec 2018 01:35:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gcKaF-0002Ih-IX for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Dec 2018 01:35:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gcKaF-0002IA-87 for pgsql-hackers@lists.postgresql.org; Thu, 27 Dec 2018 01:35:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gcKa8-0003xr-C3 for pgsql-hackers@postgresql.org; Thu, 27 Dec 2018 01:35:34 +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 wBR1ZMBt032283; Wed, 26 Dec 2018 20:35:22 -0500 From: Tom Lane To: Michael Paquier cc: Postgres hackers , Peter Eisentraut Subject: Re: pgsql: Fix failure to check for open() or fsync() failures. In-reply-to: <20181227010918.GC2106@paquier.xyz> References: <20181226224351.GA2106@paquier.xyz> <26009.1545864936@sss.pgh.pa.us> <20181227010918.GC2106@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Thu, 27 Dec 2018 10:09:18 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32281.1545874522.1@sss.pgh.pa.us> Date: Wed, 26 Dec 2018 20:35:22 -0500 Message-ID: <32282.1545874522@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Wed, Dec 26, 2018 at 05:55:36PM -0500, Tom Lane wrote: >> It appears to me that the code is intentionally not worrying about >> fsync failure, so it seems wrong for it to FATAL out if it's unable >> to open the file to fsync it. And it surely shouldn't do so if the >> file isn't there. > My point is a bit different though: it seems to me that we could just > call BasicOpenFilePerm() and remove the stat() to do exactly the same > things, simplifying the code. Oh, I see. Yeah, if we're ignoring errors anyway, the stat calls seem redundant. regards, tom lane