pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Rework compression options of pg_receivewal
Date: Wed, 13 Apr 2022 02:10:58 +0000
Message-ID: <E1neSTC-000GO0-2R@gemulon.postgresql.org> (raw)

Rework compression options of pg_receivewal

Since babbbb5 and the introduction of LZ4 in pg_receivewal, the
compression of the WAL archived is controlled by two options:
- --compression-method with "gzip", "none" or "lz4" as possible value.
- --compress=N to specify a compression level.  This includes a
backward-incompatible change where a value of 0 leads to a failure
instead of no compression enforced.

This commit takes advantage of a4b5754 and 3603f7c to rework the
compression options of pg_receivewal, as of:
- The removal of --compression-method.
- The extenction of --compress to use the same grammar as pg_basebackup,
with a METHOD:DETAIL format, where a METHOD is "gzip", "none" or "lz4"
and a DETAIL is a comma-separated list of options, the only keyword
supported is now "level" to control the compression level.  If only an
integer is specified as value of this option, "none" is implied on 0
and "gzip" is implied otherwise.  This brings back --compress to be
backward-compatible with ~14, while still supporting LZ4.

This has also the advantage of centralizing the set of checks used by
pg_receivewal to validate its compression options.

Author: Michael Paquier
Reviewed-by: Robert Haas, Georgios Kokolatos
Discussion: https://postgr.es/m/YlPQGNAAa04raObK@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/042a923ad53dfbe39a9d5012d6c3cf3c9c338884

Modified Files
--------------
doc/src/sgml/ref/pg_receivewal.sgml          |  45 +++++-----
src/bin/pg_basebackup/pg_receivewal.c        | 127 +++++++++++++++++++--------
src/bin/pg_basebackup/t/020_pg_receivewal.pl |  28 ++----
3 files changed, 121 insertions(+), 79 deletions(-)



view thread (2+ messages)

Message-ID: <E1neSTC-000GO0-2R@gemulon.postgresql.org>
Permalink:  ../E1neSTC-000GO0-2R@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1neSTC-000GO0-2R@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: michael@paquier.xyz
  Subject: Re: pgsql: Rework compression options of pg_receivewal
  In-Reply-To: <E1neSTC-000GO0-2R@gemulon.postgresql.org>
  References: <E1neSTC-000GO0-2R@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