pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix a few goofs in new backup compression code.
Date: Mon, 28 Mar 2022 16:27:48 +0000
Message-ID: <E1nYsDb-001mPY-Dy@gemulon.postgresql.org> (raw)

Fix a few goofs in new backup compression code.

When we try to set the zstd compression level either on the client
or on the server, check for errors.

For any algorithm, on the client side, don't try to set the compression
level unless the user specified one. This was visibly broken for
zstd, which managed to set -1 rather than 0 in this case, but tidy
up the code for the other methods, too.

On the client side, if we fail to create a ZSTD_CCtx, exit after
reporting the error. Otherwise we'll dereference a null pointer.

Patch by me, reviewed by Dipesh Pandit.

Discussion: http://postgr.es/m/CA+TgmoZK3zLQUCGi1h4XZw4jHiAWtcACc+GsdJR1_Mc19jUjXA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/61762426e6edbe87100dd5a4f107e8c06a11ec02

Modified Files
--------------
src/backend/replication/basebackup_zstd.c |  8 ++++++--
src/bin/pg_basebackup/bbstreamer_gzip.c   |  3 ++-
src/bin/pg_basebackup/bbstreamer_lz4.c    |  3 ++-
src/bin/pg_basebackup/bbstreamer_zstd.c   | 19 +++++++++++++++++--
4 files changed, 27 insertions(+), 6 deletions(-)



Message-ID: <E1nYsDb-001mPY-Dy@gemulon.postgresql.org>
Permalink:  ../E1nYsDb-001mPY-Dy@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nYsDb-001mPY-Dy@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: Fix a few goofs in new backup compression code.
  In-Reply-To: <E1nYsDb-001mPY-Dy@gemulon.postgresql.org>
  References: <E1nYsDb-001mPY-Dy@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox