pgsql: Handle concatenated gzip members in astreamer decompressor

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Handle concatenated gzip members in astreamer decompressor
Date: 2026-10-08 19:59:12
Message-ID: E1xEuGm-00000000rGN-1wnK@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Handle concatenated gzip members in astreamer decompressor

With WAL streaming, pg_basebackup -Ft -z writes pg_wal.tar.gz as a
series of gzip members. The decompressor did not reset the inflate
state when one ended, so inflate consumed nothing more and the loop
never finished. This caused pg_waldump to hang on such backups and
as a consequence pg_verifybackup (which use pg_waldump) would hang.

A test is added to pg_verifybackup for checking a gzip-compressed
tar backup, which in turn will verify that pg_waldump works.

Author: Shihao Zhong <zhong950419(at)gmail(dot)com>
Reviewed-by: Daniel Gustafsson <daniel(at)yesql(dot)se>
Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reviewed-by: Andrew Dunstan <andrew(at)dunslane(dot)net>
Discussion: https://postgr.es/m/CAGRkXqTcyuog_MzKqQm+am2xMefLFJTSKaRevnfypDWirCFvdA@mail.gmail.com
Backpatch-through: 19

Branch
------
master

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

Modified Files
--------------
src/bin/pg_verifybackup/t/007_wal.pl | 22 ++++++++++++++++++++++
src/fe_utils/astreamer_gzip.c | 8 ++++++++
2 files changed, 30 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-10-08 19:59:42 pgsql: Handle concatenated gzip members in astreamer decompressor
Previous Message Masahiko Sawada 2026-10-08 18:27:01 pgsql: Fix parallel vacuum I/O timing reporting.