Re: Incorrect errno used with %m for backend code - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Incorrect errno used with %m for backend code
Date
Msg-id 20180622191406.3f4ykhdfpoqozgu3@alap3.anarazel.de
Whole thread Raw
In response to Re: Incorrect errno used with %m for backend code  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Hi,

On 2018-06-22 11:15:53 -0400, Alvaro Herrera wrote:
> I don't understand the logic in RestoreSlotFromDisk that fsync the file
> prior to reading it.  What are we protecting against?

we could previously have crashed before fsyncing. But we can only rely
on slot contents being durable if we fsync them. Therefore we fsync
before reading, after a crash.


> Anyway, while I think it would be nice to have CloseTransientFile
> restore the original errno if there was one and close goes well, it
> probably unduly complicates its API contract.

Yea, agreed.

Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [PATCH] Include application_name in "connection authorized" logmessage
Next
From: sixela
Date:
Subject: Re: pg_verify_checksums review