pgsql: Change client-side fsync_fname() to report errors fatally - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Change client-side fsync_fname() to report errors fatally
Date
Msg-id E1j6GBq-000222-MD@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Change client-side fsync_fname() to report errors fatally

Given all we have learned about fsync() error handling in the last few
years, reporting an fsync() error non-fatally is not useful,
unless you don't care much about the file, in which case you probably
don't need to use fsync() in the first place.

Change fsync_fname() and durable_rename() to exit(1) on fsync() errors
other than those that we specifically chose to ignore.

This affects initdb, pg_basebackup, pg_checksums, pg_dump, pg_dumpall,
and pg_rewind.

Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://www.postgresql.org/message-id/flat/d239d1bd-aef0-ca7c-dc0a-da14bdcf0392%402ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1420617b14e2e3722367b826986a50ea33ff62ec

Modified Files
--------------
src/common/file_utils.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Adapt hashfn.c and hashutils.h for frontend use.
Next
From: Tom Lane
Date:
Subject: pgsql: Account explicitly for long-lived FDs that are allocated outside