Re: refactoring basebackup.c

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>
Cc: Dipesh Pandit <dipesh(dot)pandit(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Jeevan Ladhe <jeevan(dot)ladhe(at)enterprisedb(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: refactoring basebackup.c
Date: 2022-01-27 17:42:39
Message-ID: CA+TgmoZfP=rsZB_9vDGfhuNgSu_M_09UWu8SjvsP65y_1pQFCg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 27, 2022 at 12:08 PM tushar <tushar(dot)ahuja(at)enterprisedb(dot)com> wrote:
> On 1/27/22 10:17 PM, Robert Haas wrote:
> > Cool. I committed that patch.
> Thanks , Please refer to this scenario where the label is set to 0 for
> server-gzip but the directory is still compressed
>
> [edb(at)centos7tushar bin]$ ./pg_basebackup -t server:/tmp/11 --gzip
> --compress=0 -Xnone
> NOTICE: all required WAL segments have been archived
> [edb(at)centos7tushar bin]$ ls /tmp/11
> 16384.tar backup_manifest base.tar
>
>
> [edb(at)centos7tushar bin]$ ./pg_basebackup -t server:/tmp/10 --gzip
> --compress=server-gzip:0 -Xnone
> NOTICE: all required WAL segments have been archived
> [edb(at)centos7tushar bin]$ ls /tmp/10
> 16384.tar.gz backup_manifest base.tar.gz
>
> 0 is for no compression so the directory should not be compressed if we
> mention server-gzip:0 and both these
> above scenarios should match?

Well what's weird here is that you are using both --gzip and also
--compress. Those both control the same behavior, so it's a surprising
idea to specify both. But I guess if someone does, we should make the
second one fully override the first one. Here's a patch to try to do
that.

--
Robert Haas
EDB: http://www.enterprisedb.com

Attachment Content-Type Size
overwrite-compression-level.patch application/octet-stream 571 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2022-01-27 17:55:45 Creation of an empty table is not fsync'd at checkpoint
Previous Message tushar 2022-01-27 17:08:15 Re: refactoring basebackup.c