Re: Fix some error handling for read() and errno - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Fix some error handling for read() and errno
Date
Msg-id CA+TgmoY2JV+feQ62K=9uXwncVgQ6NW0R0_T3uB9yDCqFgKWZzw@mail.gmail.com
Whole thread Raw
In response to Re: Fix some error handling for read() and errno  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Fix some error handling for read() and errno
List pgsql-hackers
On Thu, Jun 21, 2018 at 2:32 AM, Michael Paquier <michael@paquier.xyz> wrote:
> Sure.  I have looked at that and I am finishing with the updated version
> attached.
>
> I removed the portion about slru in the code, but I would like to add at
> least a mention about it in the commit message.  The simplifications are
> also applied for the control file messages you changed as well in
> cfb758b.  Also in ReadControlFile(), we use "could not open control
> file", so for consistency this should be replaced with a more simple
> message.  I noticed as well that the 2PC file handling loses errno a
> couple of times, and that we had better keep the messages also
> consistent if we do the simplification move...  relmapper.c also gains
> simplifications.
>
> All the incorrect errno handling I found should be back-patched in my
> opinion as we did so in the past with 2a11b188 for example.  I am not
> really willing to bother about the error message improvements on
> anything else than HEAD (not v11, but v12), but...  Opinions about all
> that?

I think this should be split into two patches.  Fixing failure to save
and restore errno is a different issue from cleaning up short write
messages.  I agree that the former should be back-patched and the
latter not.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Keeping temporary tables in shared buffers
Next
From: Robert Haas
Date:
Subject: Re: "wal receiver" process hang in syslog() while exiting afterreceiving SIGTERM while the postgres has been promoted.