From 1e2fddfa33d3c7cc93ca3ee0f32852699bd3e012 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 29 Jul 2019 07:41:06 +0200 Subject: 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 Reviewed-by: Sehrope Sarkuni Discussion: https://www.postgresql.org/message-id/flat/9b49fe44-8f3e-eca9-5914-29e9e99030bf@2ndquadrant.com --- src/bin/pg_basebackup/walmethods.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bin/pg_basebackup/walmethods.c') diff --git a/src/bin/pg_basebackup/walmethods.c b/src/bin/pg_basebackup/walmethods.c index 83b520898be..8ec12e6f723 100644 --- a/src/bin/pg_basebackup/walmethods.c +++ b/src/bin/pg_basebackup/walmethods.c @@ -864,7 +864,7 @@ tar_close(Walfile f, WalCloseMethod method) /* Always fsync on close, so the padding gets fsynced */ if (tar_sync(f) < 0) - return -1; + exit(1); /* Clean up and done */ pg_free(tf->pathname); -- cgit v1.2.3