pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Postgres hackers <pgsql-hackers@postgresql.org>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Subject: Re: pgsql: Fix failure to check for open() or fsync() failures.
Date: Wed, 26 Dec 2018 17:55:36 -0500
Message-ID: <26009.1545864936@sss.pgh.pa.us> (raw)
In-Reply-To: <20181226224351.GA2106@paquier.xyz>
References: <E1gcGPf-0000Ih-1f@gemulon.postgresql.org>
	<20181226224351.GA2106@paquier.xyz>

Michael Paquier <michael@paquier.xyz> writes:
> On Wed, Dec 26, 2018 at 09:08:23PM +0000, Tom Lane wrote:
>> Fix failure to check for open() or fsync() failures.
>> 
>> While it seems OK to not be concerned about fsync() failure for a
>> pre-existing signal file, it's not OK to not even check for open()
>> failure.  This at least causes complaints from static analyzers,

> Wouldn't it be more simple to remove stat() and just call
> BasicOpenFilePerm, complaining with FATAL about any failures,
> including EACCES, on the way?  The code is racy as designed, even if
> that's not a big deal for recovery purposes.

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.

			regards, tom lane




view thread (7+ messages)  latest in thread

Message-ID: <26009.1545864936@sss.pgh.pa.us>
Permalink:  ../26009.1545864936@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26009.1545864936@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, pgsql-hackers@postgresql.org, peter.eisentraut@2ndquadrant.com
  Subject: Re: pgsql: Fix failure to check for open() or fsync() failures.
  In-Reply-To: <26009.1545864936@sss.pgh.pa.us>
  References: <E1gcGPf-0000Ih-1f@gemulon.postgresql.org> <20181226224351.GA2106@paquier.xyz> <26009.1545864936@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