Re: Tighten error control for OpenTransientFile/CloseTransientFile

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Georgios Kokolatos <gkokolatos@pm.me>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2019-03-07T01:56:25Z
Lists: pgsql-hackers

Attachments

On Wed, Mar 06, 2019 at 02:54:52PM +0000, Georgios Kokolatos wrote:
> Overall the patch looks good and according to the previous
> discussion fulfils its purpose. 
> 
> It might be worthwhile to also check for errors on close in
> SaveSlotToPath().

Thanks for the feedback, added.  I have spent some time
double-checking this stuff, and noticed that the new errors in
StartupReplicationOrigin() and CheckPointReplicationOrigin() should be
switched from ERROR to PANIC to be consistent.  One message in
dsm_impl_mmap() was not consistent either.

Are there any objections if I commit this patch?
--
Michael

Commits

  1. Tighten use of OpenTransientFile and CloseTransientFile

  2. PANIC on fsync() failure.