Re: pg_basebackup wish list

Lists: pgsql-hackers
From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup wish list
Date: 2016-07-28 12:07:11
Message-ID: CAHGQGwEBfZdi3JuT5XPQnGfw36NRPmq0Bb5dQgdyzXS9qkqkqA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Jul 28, 2016 at 8:44 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> On Tue, Jul 26, 2016 at 11:58 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> On Wed, Jul 13, 2016 at 3:06 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
>>> On Tue, Jul 12, 2016 at 10:48 AM, Peter Eisentraut
>>> <peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
>>>> On 7/12/16 12:53 PM, Jeff Janes wrote:
>>>>> The --help message for pg_basebackup says:
>>>>>
>>>>> -Z, --compress=0-9 compress tar output with given compression level
>>>>>
>>>>> But -Z0 is then rejected as 'invalid compression level "0"'. The real
>>>>> docs do say 1-9, only the --help message has this bug. Trivial patch
>>>>> attached.
>>>>
>>>> pg_dump --help and man page say it supports 0..9. Maybe we should make
>>>> that more consistent.
>>>
>>> pg_dump actually does support -Z0, though. Well, sort of. It outputs
>>> plain text. Rather than plain text wrapped in some kind of dummy gzip
>>> header, which is what I had naively expected.
>>>
>>> Is that what -Z0 in pg_basebackup should do as well, just output
>>> uncompressed tar data, and not add the ".gz" to the "base.tar" file
>>> name?
>>
>> Yes, I think. What about the attached patch?
>>
>
> What if user tries to use -Z 0 with format as tar, won't it generate
> base.tar without any compression?

Yes, with -Z 0 -F t options, the patched version of pg_basebackup generate
base.tar without compression.

> I am not sure if that is what Jeff
> intends to say in his proposal.

Maybe I failed to parse his proposal. It's helpful if you elaborate it.

Regards,

--
Fujii Masao


From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup wish list
Date: 2016-07-28 13:16:53
Message-ID: CAA4eK1Lx5jJWxtgC-6CavydCp32mWAzaKky=bSKc+GTdUt2jSg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Jul 28, 2016 at 5:37 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>
> Maybe I failed to parse his proposal. It's helpful if you elaborate it.
>

As per mail [1], it seems the proposal is not to use .tar for -Z 0.
Now here actually we are on the fence, one can argue that if user
doesn't want compression, he or she can use -F p (plain format).
OTOH, without compression getting the backup as a single .tar file
makes it simple to manage. I think there is some value in providing
.tar for -Z 0, however in that case how should we define usage of -F p
-Z 0? Shall we say with plain format -Z 0 gets ignored or throw error
or do something else? If first, then I think it is better to mention
the same in docs.

[1] - https://www.postgresql.org/message-id/CAMkU%3D1zzj0et2x9fCqxMGJ6XP-FtMSUwtNQGwF01698FRWQ6uA%40mail.gmail.com
--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup wish list
Date: 2016-07-28 14:04:49
Message-ID: CAHGQGwEd-c52uAYqhjdHaEmt++e81oEsnUgoo6OKQ7vxKFO-Ag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Jul 28, 2016 at 10:16 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> On Thu, Jul 28, 2016 at 5:37 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>
>> Maybe I failed to parse his proposal. It's helpful if you elaborate it.
>>
>
> As per mail [1], it seems the proposal is not to use .tar for -Z 0.

I was thinking that the proposal is "output uncompressed tar data,
and not add the ".gz" to the "base.tar" file name" part. So, if -Z 0 is
specified with tar format, .gz should not be added as a file extension.

> Now here actually we are on the fence, one can argue that if user
> doesn't want compression, he or she can use -F p (plain format).
> OTOH, without compression getting the backup as a single .tar file
> makes it simple to manage.

Right now we are providing both methods, plain and tar formats
(without compression, i.e., neither -z nor -Z options are specified).

> I think there is some value in providing
> .tar for -Z 0,

I was thinking that "-Ft -Z0" is something like an alias of "-Ft".
That is, the backup is taken in uncompressed tar format.

> however in that case how should we define usage of -F p
> -Z 0? Shall we say with plain format -Z 0 gets ignored or throw error
> or do something else? If first, then I think it is better to mention
> the same in docs.

ISTM that it's better to ignore that case, like pg_dump -Ft -Z0
doesn't throw an error.

Regards,

--
Fujii Masao


From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup wish list
Date: 2016-07-29 14:01:40
Message-ID: CAA4eK1+c-Gyz5EEd_Bu5JZRdzJ1hXfWnWfmktxCX3RGk7n63Gw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Jul 28, 2016 at 7:34 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Thu, Jul 28, 2016 at 10:16 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
>> I think there is some value in providing
>> .tar for -Z 0,
>
> I was thinking that "-Ft -Z0" is something like an alias of "-Ft".
> That is, the backup is taken in uncompressed tar format.
>
>> however in that case how should we define usage of -F p
>> -Z 0? Shall we say with plain format -Z 0 gets ignored or throw error
>> or do something else? If first, then I think it is better to mention
>> the same in docs.
>
> ISTM that it's better to ignore that case, like pg_dump -Ft -Z0
> doesn't throw an error.
>

Okay, then you can go ahead with your patch.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup wish list
Date: 2016-08-01 08:39:34
Message-ID: CAHGQGwEE5-znk2o5DgsQrzPwcmdzhWHdDwtCBeoXr0o5Lfx6Jg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jul 29, 2016 at 11:01 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> On Thu, Jul 28, 2016 at 7:34 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> On Thu, Jul 28, 2016 at 10:16 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>>
>>> I think there is some value in providing
>>> .tar for -Z 0,
>>
>> I was thinking that "-Ft -Z0" is something like an alias of "-Ft".
>> That is, the backup is taken in uncompressed tar format.
>>
>>> however in that case how should we define usage of -F p
>>> -Z 0? Shall we say with plain format -Z 0 gets ignored or throw error
>>> or do something else? If first, then I think it is better to mention
>>> the same in docs.
>>
>> ISTM that it's better to ignore that case, like pg_dump -Ft -Z0
>> doesn't throw an error.
>>
>
> Okay, then you can go ahead with your patch.

Thanks for the comment! I pushed the patch.

Regards,

--
Fujii Masao