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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Exit after fatal errors in client-side compression code.
Date: 2026-03-05 19:43:39
Message-ID: E1vyEbj-002Ytf-0h@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)sss(dot)pgh(dot)pa(dot)us>
Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Discussion: https://postgr.es/m/1531718.1772644615@sss.pgh.pa.us
Backpatch-through: 15

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8b198b093fd2ccc2712f6b5a43665818310698f4

Modified Files
--------------
src/bin/pg_basebackup/bbstreamer_gzip.c | 2 +-
src/bin/pg_basebackup/bbstreamer_lz4.c | 20 ++++++++++----------
src/bin/pg_basebackup/bbstreamer_zstd.c | 19 ++++++++-----------
src/bin/pg_dump/compress_lz4.c | 13 +++++++++++--
4 files changed, 30 insertions(+), 24 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Melanie Plageman 2026-03-05 21:11:53 pgsql: Move commonly used context into PruneState and simplify helpers
Previous Message Jacob Champion 2026-03-05 18:12:03 pgsql: libpq: Add PQgetThreadLock() to mirror PQregisterThreadLock()