Re: Refactoring of compression options in pg_basebackup

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Michael Paquier <michael(at)paquier(dot)xyz>, Georgios Kokolatos <gkokolatos(at)pm(dot)me>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Jeevan Ladhe <jeevan(dot)ladhe(at)enterprisedb(dot)com>
Subject: Re: Refactoring of compression options in pg_basebackup
Date: 2022-01-17 15:41:44
Message-ID: 202201171541.vmc7pwyksder@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2022-Jan-17, Robert Haas wrote:

> Of the two
> alternatives that you propose, I prefer --compress=["server-"]METHOD
> and --compression-level=NUMBER to having both
> --client-compression-level and --server-compression-level. To me,
> that's still a bit more surprising than my proposal, because having
> the client compress stuff and having the server compress stuff feel
> like somewhat different kinds of things ... but it's unsurprising that
> I like my own proposal, and what really matters is that we converge
> relatively quickly on something we can all live with.

I think having a single option where you specify everything is simpler.
I propose we accept these forms:

--compress=[{server,client}-]method[:level] new in 15
--compress=level (accepted by 14)
-Z level (accepted by 14)
-z (accepted by 14)

This way, compatibility with the existing release is maintained; and we
introduce all the new functionality without cluttering the interface.

So starting from 15, in addition to the already supported forms, users
will be able to do

--compress=server-gzip:8 (completely specified options)
--compress=client-lz4 (client-side lz4 compression, default level)
--compress=zstd (server-side zstd compression)

there's a bit of string parsing required to implement, but that seems
okay to me -- the UI seems clear enough and easily documented.

One missing feature in this spec is the ability to specify compression
to be used with whatever the default method is. I'm not sure we want to
allow for that, but it could be
--compress=client
--compress=server
which uses whatever method is default, with whatever level is default,
at either side.

--
Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2022-01-17 15:42:12 Re: Refactoring of compression options in pg_basebackup
Previous Message Julien Rouhaud 2022-01-17 15:38:43 Re: 2022-01 Commitfest