Re: Tighten error control for OpenTransientFile/CloseTransientFile

gkokolatos@pm.me

From: Georgios Kokolatos <gkokolatos@pm.me>
To: pgsql-hackers@lists.postgresql.org
Cc: Michael Paquier <michael@paquier.xyz>
Date: 2019-03-06T14:54:52Z
Lists: pgsql-hackers
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().

        pgstat_report_wait_end();

        CloseTransientFile(fd);

        /* rename to permanent file, fsync file and directory */
        if (rename(tmppath, path) != 0)

Commits

  1. Tighten use of OpenTransientFile and CloseTransientFile

  2. PANIC on fsync() failure.