pgsql: Exit after fatal errors in client-side compression code.

Started by Tom Lane5 months ago1 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Exit after fatal errors in client-side compression code.

It looks like whoever wrote the astreamer (nee bbstreamer) code
thought that pg_log_error() is equivalent to elog(ERROR), but
it's not; it just prints a message. So all these places tried to
continue on after a compression or decompression error return,
with the inevitable result being garbage output and possibly
cascading error messages. We should use pg_fatal() instead.

These error conditions are probably pretty unlikely in practice,
which no doubt accounts for the lack of field complaints.

Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: /messages/by-id/1531718.1772644615@sss.pgh.pa.us
Backpatch-through: 15

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a01a592b1193c4a22d897393d664f5888f7a25b5

Modified Files
--------------
src/bin/pg_dump/compress_lz4.c | 13 +++++++++++--
src/fe_utils/astreamer_gzip.c | 2 +-
src/fe_utils/astreamer_lz4.c | 20 ++++++++++----------
src/fe_utils/astreamer_zstd.c | 19 ++++++++-----------
4 files changed, 30 insertions(+), 24 deletions(-)