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 1gcLRv-0004kM-7i for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Dec 2018 02:31:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gcLRt-0004Pb-CT for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Dec 2018 02:31:01 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1gcLRt-0004PU-5N for pgsql-hackers@lists.postgresql.org; Thu, 27 Dec 2018 02:31:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gcLRo-0007NO-FR for pgsql-hackers@postgresql.org; Thu, 27 Dec 2018 02:31:00 +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 wBR2Un5E002390; Wed, 26 Dec 2018 21:30:49 -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: <20181227021039.GI2106@paquier.xyz> References: <20181226224351.GA2106@paquier.xyz> <26009.1545864936@sss.pgh.pa.us> <20181227010918.GC2106@paquier.xyz> <32282.1545874522@sss.pgh.pa.us> <20181227021039.GI2106@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Thu, 27 Dec 2018 11:10:39 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2388.1545877849.1@sss.pgh.pa.us> Date: Wed, 26 Dec 2018 21:30:49 -0500 Message-ID: <2389.1545877849@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 08:35:22PM -0500, Tom Lane wrote: >> Oh, I see. Yeah, if we're ignoring errors anyway, the stat calls >> seem redundant. > For this one, I think that we could simplify as attached (this causes > open() to fail additionally because of the sync flags, but that's not > really worth worrying). Thoughts? Actually, now that I think a bit more, this isn't a good idea. We want standby_signal_file_found (resp. recovery_signal_file_found) to get set if the file exists, even if we're unable to fsync it for some reason. A counterexample to the proposed patch is that a signal file that's read-only to the server will get ignored, which it should not be. regards, tom lane