public inbox for [email protected]  
help / color / mirror / Atom feed
PG 14 pg_basebackup accepts --compress=server-zst option
5+ messages / 4 participants
[nested] [flat]

* PG 14 pg_basebackup accepts --compress=server-zst option
@ 2024-06-07 01:54  Ron Johnson <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Ron Johnson @ 2024-06-07 01:54 UTC (permalink / raw)
  To: pgsql-general

https://www.postgresql.org/docs/14/app-pgbasebackup.html doesn't mention
"--compress=[{client|server}-]method".  That first appears in the v15 docs.

And yet pg_basebackup doesn't complain about an invalid option.
(Technically, this is a bug; I first noticed it a week after copying a
script from a PG 15 server to five PG 14 servers, and running it quite a
few times without fail.)

$ pg_basebackup \
>             --pgdata=$PGDATA \
>             --dbname=service=basebackup \
>             --verbose --progress \
>             --checkpoint=fast \
>             --write-recovery-conf \
>             --wal-method=stream \
>             --create-slot --slot=pgstandby1 \
>             --compress=server-zst ; echo $?
pg_basebackup: initiating base backup, waiting for checkpoint to complete
pg_basebackup: checkpoint completed
pg_basebackup: write-ahead log start point: 256/BC000028 on timeline 1
pg_basebackup: starting background WAL receiver
pg_basebackup: created replication slot "pgstandby1"
42567083/42567083 kB (100%), 1/1 tablespace
pg_basebackup: write-ahead log end point: 256/BC000138
pg_basebackup: waiting for background process to finish streaming ...
pg_basebackup: syncing data to disk ...
pg_basebackup: renaming backup_manifest.tmp to backup_manifest
pg_basebackup: base backup completed
0


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PG 14 pg_basebackup accepts --compress=server-zst option
@ 2024-06-07 04:27  Kashif Zeeshan <[email protected]>
  parent: Ron Johnson <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Kashif Zeeshan @ 2024-06-07 04:27 UTC (permalink / raw)
  To: Ron Johnson <[email protected]>; +Cc: pgsql-general

Hi

On Fri, Jun 7, 2024 at 6:54 AM Ron Johnson <[email protected]> wrote:

>
> https://www.postgresql.org/docs/14/app-pgbasebackup.html doesn't mention
> "--compress=[{client|server}-]method".  That first appears in the v15 docs.
>
> And yet pg_basebackup doesn't complain about an invalid option.
> (Technically, this is a bug; I first noticed it a week after copying a
> script from a PG 15 server to five PG 14 servers, and running it quite a
> few times without fail.)
>
If the support is removed then it should be mentioned in the official
documentation.

Regards
Kashif Zeeshan
Bitnine Global

>
> $ pg_basebackup \
> >             --pgdata=$PGDATA \
> >             --dbname=service=basebackup \
> >             --verbose --progress \
> >             --checkpoint=fast \
> >             --write-recovery-conf \
> >             --wal-method=stream \
> >             --create-slot --slot=pgstandby1 \
> >             --compress=server-zst ; echo $?
> pg_basebackup: initiating base backup, waiting for checkpoint to complete
> pg_basebackup: checkpoint completed
> pg_basebackup: write-ahead log start point: 256/BC000028 on timeline 1
> pg_basebackup: starting background WAL receiver
> pg_basebackup: created replication slot "pgstandby1"
> 42567083/42567083 kB (100%), 1/1 tablespace
> pg_basebackup: write-ahead log end point: 256/BC000138
> pg_basebackup: waiting for background process to finish streaming ...
> pg_basebackup: syncing data to disk ...
> pg_basebackup: renaming backup_manifest.tmp to backup_manifest
> pg_basebackup: base backup completed
> 0
>
>


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PG 14 pg_basebackup accepts --compress=server-zst option
@ 2024-06-07 04:32  David G. Johnston <[email protected]>
  parent: Kashif Zeeshan <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: David G. Johnston @ 2024-06-07 04:32 UTC (permalink / raw)
  To: Kashif Zeeshan <[email protected]>; +Cc: Ron Johnson <[email protected]>; pgsql-general

On Thursday, June 6, 2024, Kashif Zeeshan <[email protected]> wrote:

> Hi
>
> On Fri, Jun 7, 2024 at 6:54 AM Ron Johnson <[email protected]>
> wrote:
>
>>
>> https://www.postgresql.org/docs/14/app-pgbasebackup.html doesn't mention
>> "--compress=[{client|server}-]method".  That first appears in the v15
>> docs.
>>
>> And yet pg_basebackup doesn't complain about an invalid option.
>> (Technically, this is a bug; I first noticed it a week after copying a
>> script from a PG 15 server to five PG 14 servers, and running it quite a
>> few times without fail.)
>>
>
Seems a bit suspect, but as your script doesn’t mention tar the option
itself is apparently ignored, I guess silently.  Assuming this isn’t an
actual regression in behavior in a patch-released older version I don’t see
us adding an error message at this point.


> If the support is removed then it should be mentioned in the official
> documentation.
>

Support wasn’t removed.  Re-read the email and check the version/times
being mentioned again.

David J.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PG 14 pg_basebackup accepts --compress=server-zst option
@ 2024-06-07 12:04  Ron Johnson <[email protected]>
  parent: David G. Johnston <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Ron Johnson @ 2024-06-07 12:04 UTC (permalink / raw)
  To: pgsql-general

On Fri, Jun 7, 2024 at 12:32 AM David G. Johnston <
[email protected]> wrote:

> On Thursday, June 6, 2024, Kashif Zeeshan <[email protected]> wrote:
>
>> Hi
>>
>> On Fri, Jun 7, 2024 at 6:54 AM Ron Johnson <[email protected]>
>> wrote:
>>
>>>
>>> https://www.postgresql.org/docs/14/app-pgbasebackup.html doesn't
>>> mention "--compress=[{client|server}-]method".  That first appears in the
>>> v15 docs.
>>>
>>> And yet pg_basebackup doesn't complain about an invalid option.
>>> (Technically, this is a bug; I first noticed it a week after copying a
>>> script from a PG 15 server to five PG 14 servers, and running it quite a
>>> few times without fail.)
>>>
>>
> Seems a bit suspect, but as your script doesn’t mention tar the option
> itself is apparently ignored, I guess silently.
>

Does this mean that "--compress=server-zst" is only relevant with
--format=tar?


> Assuming this isn’t an actual regression in behavior in a patch-released
> older version
>

My apologies for not mentioning the version: 14.12-1PGDG-rhel8.


> I don’t see us adding an error message at this point.
>

Me neither.  It just seemed odd.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: PG 14 pg_basebackup accepts --compress=server-zst option
@ 2024-06-07 15:33  Tom Lane <[email protected]>
  parent: Ron Johnson <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2024-06-07 15:33 UTC (permalink / raw)
  To: Ron Johnson <[email protected]>; +Cc: pgsql-general

Ron Johnson <[email protected]> writes:
> On Fri, Jun 7, 2024 at 12:32 AM David G. Johnston <
> [email protected]> wrote:
>> I don’t see us adding an error message at this point.

> Me neither.  It just seemed odd.

v14 thinks the argument of --compress must be an integer, and doesn't
really bother with any syntax error checks:

            case 'Z':
                compresslevel = atoi(optarg);
                if (compresslevel < 0 || compresslevel > 9)
                {
                    pg_log_error("invalid compression level \"%s\"", optarg);
                    exit(1);
                }
                break;

In your example, atoi() will return zero and it will sail along with
no compression.  Releases 15 and up have more complex ideas of what
--compress can specify, and seem to syntax-check it much more
thoroughly.

This is a pretty common coding pattern, so I can't get excited
about changing it, especially not in long-stable branches.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2024-06-07 15:33 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-06-07 01:54 PG 14 pg_basebackup accepts --compress=server-zst option Ron Johnson <[email protected]>
2024-06-07 04:27 ` Kashif Zeeshan <[email protected]>
2024-06-07 04:32   ` David G. Johnston <[email protected]>
2024-06-07 12:04     ` Ron Johnson <[email protected]>
2024-06-07 15:33       ` Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox