Re: refactoring basebackup.c

From: Jeevan Ladhe <jeevanladhe(dot)os(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "Shinoda, Noriyoshi (PN Japan FSIP)" <noriyoshi(dot)shinoda(at)hpe(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Dipesh Pandit <dipesh(dot)pandit(at)gmail(dot)com>, Abhijit Menon-Sen <ams(at)toroid(dot)org>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Jeevan Ladhe <jeevan(dot)ladhe(at)enterprisedb(dot)com>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>
Subject: Re: refactoring basebackup.c
Date: 2022-02-15 13:18:41
Message-ID: CANm22CjESZPRiGB5Cs3EJQhsKs8R5dbfYt8Z=ni4=TLMbcW9iw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Please find the attached updated version of patch for ZSTD server side
compression.

This patch has following changes:

- Fixes the issue Tushar reported[1].
- Adds a tap test.
- Makes document changes related to zstd.
- Updates pg_basebackup help for pg_basebackup. Here I have chosen the
suggestion by Robert upthread (as given below):

>> I would be somewhat inclined to leave the level-only variant
>> undocumented and instead write it like this:
>> -Z, --compress={[{client|server}-]{gzip|lz4}}[:LEVEL]|none}

- pg_indent on basebackup_zstd.c.

Thanks Tushar, for offline help for testing the patch.

[1]
https://www.postgresql.org/message-id/6c3f1558-1e56-9946-78a2-c59340da1dbf%40enterprisedb.com

Regards,
Jeevan Ladhe

On Mon, 14 Feb 2022 at 21:30, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Sat, Feb 12, 2022 at 1:01 AM Shinoda, Noriyoshi (PN Japan FSIP)
> <noriyoshi(dot)shinoda(at)hpe(dot)com> wrote:
> > Thank you for developing a great feature.
> > The current help message shown below does not seem to be able to specify
> the 'client-' or 'server-' for lz4 compression.
> > --compress = {[{client, server}-]gzip, lz4, none}[:LEVEL]
> >
> > The attached small patch fixes the help message as follows:
> > --compress = {[{client, server}-]{gzip, lz4}, none}[:LEVEL]
>
> Hmm. After studying this a bit more closely, I think this might
> actually need a bit more revision than what you propose here. In most
> places, we use vertical bars to separate alternatives:
>
> -X, --wal-method=none|fetch|stream
>
> But here, we're using commas in some places and the word "or" in one
> case as well:
>
> -Z, --compress={[{client,server}-]gzip,lz4,none}[:LEVEL] or [LEVEL]
>
> We're also not consistently using braces for grouping, which makes the
> order of operations a bit unclear, and it makes no sense to put
> brackets around LEVEL when it's the only thing that's part of that
> alternative.
>
> A more consistent way of writing the supported syntax would be like this:
>
> -Z, --compress={[{client|server}-]{gzip|lz4}}[:LEVEL]|LEVEL|none}
>
> I would be somewhat inclined to leave the level-only variant
> undocumented and instead write it like this:
>
> -Z, --compress={[{client|server}-]{gzip|lz4}}[:LEVEL]|none}
>
> --
> Robert Haas
> EDB: http://www.enterprisedb.com
>

Attachment Content-Type Size
v10-0001-Add-a-ZSTD-compression-method-for-server-side-compre.patch application/octet-stream 36.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2022-02-15 13:32:28 Re: OpenSSL conflicts with wincrypt.h
Previous Message Juan José Santamaría Flecha 2022-02-15 13:12:47 Re: OpenSSL conflicts with wincrypt.h