Re: refactoring basebackup.c

From: tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(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-28 10:45:41
Message-ID: a0fb2e78-330b-7f8a-687b-1745b60c95a1@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/27/22 11:12 PM, Robert Haas wrote:
> 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.
right, the current behavior was  -

[edb(at)centos7tushar bin]$ ./pg_basebackup  -t server:/tmp/y101 --gzip -Z
none  -Xnone
pg_basebackup: error: cannot use compression level with method none
Try "pg_basebackup --help" for more information.

and even this was not matching with PG v14 behavior too
e.g
 ./pg_basebackup -Ft -z -Z none  -D /tmp/test1  ( working in PG v14 but
throwing above error on PG HEAD)

and somewhere we were breaking the backward compatibility.

now with your patch -this seems working fine

[edb(at)centos7tushar bin]$ ./pg_basebackup  -t server:/tmp/y101 --gzip*-Z
none*  -Xnone
NOTICE:  WAL archiving is not enabled; you must ensure that all required
WAL segments are copied through other means to complete the backup
[edb(at)centos7tushar bin]$ ls /tmp/y101
backup_manifest *base.tar*

OR

[edb(at)centos7tushar bin]$  ./pg_basebackup  -t server:/tmp/y0p -Z none 
-Xfetch *-z*
[edb(at)centos7tushar bin]$ ls /tmp/y0p
backup_manifest *base.tar.gz*

but what about server-gzip:0? should it allow compressing the directory?

[edb(at)centos7tushar bin]$  ./pg_basebackup  -t server:/tmp/1
--compress=server-gzip:0  -Xfetch
[edb(at)centos7tushar bin]$ ls /tmp/1
backup_manifest  base.tar.gz

--
regards,tushar
EnterpriseDB https://www.enterprisedb.com/
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dagfinn Ilmari Mannsåker 2022-01-28 10:58:09 Server-side base backup: why superuser, not pg_write_server_files?
Previous Message Bharath Rupireddy 2022-01-28 10:11:11 BeginCopyTo - remove switching to old memory context in between COPY TO command processing