diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2019-07-29 07:41:06 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2019-07-29 07:54:57 +0200 |
commit | 1e2fddfa33d3c7cc93ca3ee0f32852699bd3e012 (patch) | |
tree | f7b7e5d49b9baf01a57b3be42c030b74bffa3fb2 /src/bin/pg_basebackup/pg_recvlogical.c | |
parent | eb43f3d19324d7e5376b1f57fc2e5c142a6b5f3d (diff) | |
download | postgresql-1e2fddfa33d3c7cc93ca3ee0f32852699bd3e012.tar.gz postgresql-1e2fddfa33d3c7cc93ca3ee0f32852699bd3e012.zip |
Handle fsync failures in pg_receivewal and pg_recvlogical
It is not safe to simply report an fsync error and continue. We must
exit the program instead.
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Sehrope Sarkuni <sehrope@jackdb.com>
Discussion: https://www.postgresql.org/message-id/flat/9b49fe44-8f3e-eca9-5914-29e9e99030bf@2ndquadrant.com
Diffstat (limited to 'src/bin/pg_basebackup/pg_recvlogical.c')
-rw-r--r-- | src/bin/pg_basebackup/pg_recvlogical.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c index 90a3f41bbbe..af29dd7651a 100644 --- a/src/bin/pg_basebackup/pg_recvlogical.c +++ b/src/bin/pg_basebackup/pg_recvlogical.c @@ -192,8 +192,8 @@ OutputFsync(TimestampTz now) if (fsync(outfd) != 0) { - pg_log_error("could not fsync file \"%s\": %m", outfile); - return false; + pg_log_fatal("could not fsync file \"%s\": %m", outfile); + exit(1); } return true; |