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: Replace BASE_BACKUP COMPRESSION_LEVEL option with COMPRESSION_DE
Date: Wed, 23 Mar 2022 13:19:27 +0000
Message-ID: <E1nX0tb-0011WV-8i@gemulon.postgresql.org> (raw)

Replace BASE_BACKUP COMPRESSION_LEVEL option with COMPRESSION_DETAIL.

There are more compression parameters that can be specified than just
an integer compression level, so rename the new COMPRESSION_LEVEL
option to COMPRESSION_DETAIL before it gets released. Introduce a
flexible syntax for that option to allow arbitrary options to be
specified without needing to adjust the main replication grammar,
and common code to parse it that is shared between the client and
the server.

This commit doesn't actually add any new compression parameters,
so the only user-visible change is that you can now type something
like pg_basebackup --compress gzip:level=5 instead of writing just
pg_basebackup --compress gzip:5. However, it should make it easy to
add new options. If for example gzip starts offering fries, we can
support pg_basebackup --compress gzip:level=5,fries=true for the
benefit of users who want fries with that.

Along the way, this fixes a few things in pg_basebackup so that the
pg_basebackup can be used with a server-side compression algorithm
that pg_basebackup itself does not understand. For example,
pg_basebackup --compress server-lz4 could still succeed even if
only the server and not the client has LZ4 support, provided that
the other options to pg_basebackup don't require the client to
decompress the archive.

Patch by me. Reviewed by Justin Pryzby and Dagfinn Ilmari Mannsåker.

Discussion: http://postgr.es/m/CA+TgmoYvpetyRAbbg1M8b3-iHsaN4nsgmWPjOENu5-doHuJ7fA@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/protocol.sgml                   |  22 +-
doc/src/sgml/ref/pg_basebackup.sgml          |  25 +-
src/backend/replication/basebackup.c         |  62 ++--
src/backend/replication/basebackup_gzip.c    |  20 +-
src/backend/replication/basebackup_lz4.c     |  19 +-
src/backend/replication/basebackup_zstd.c    |  19 +-
src/bin/pg_basebackup/bbstreamer.h           |   7 +-
src/bin/pg_basebackup/bbstreamer_gzip.c      |   7 +-
src/bin/pg_basebackup/bbstreamer_lz4.c       |   4 +-
src/bin/pg_basebackup/bbstreamer_zstd.c      |   4 +-
src/bin/pg_basebackup/pg_basebackup.c        | 409 +++++++++++----------------
src/bin/pg_basebackup/t/010_pg_basebackup.pl |  72 ++++-
src/common/Makefile                          |   1 +
src/common/backup_compression.c              | 269 ++++++++++++++++++
src/include/common/backup_compression.h      |  44 +++
src/include/replication/basebackup_sink.h    |   7 +-
src/tools/msvc/Mkvcbuild.pm                  |   2 +-
17 files changed, 662 insertions(+), 331 deletions(-)



Message-ID: <E1nX0tb-0011WV-8i@gemulon.postgresql.org>
Permalink:  ../E1nX0tb-0011WV-8i@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nX0tb-0011WV-8i@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: Replace BASE_BACKUP COMPRESSION_LEVEL option with COMPRESSION_DE
  In-Reply-To: <E1nX0tb-0011WV-8i@gemulon.postgresql.org>
  References: <E1nX0tb-0011WV-8i@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