Skip to content

Commit

Permalink
Document issue with gzip and bzip on older pythons
Browse files Browse the repository at this point in the history
Updates the barman-cloud-wal-archive man page and the argument
help strings to warn people that compression options should not be
used with older python versions (<3.2 for gzip, 3.3 for bzip2).

See issue #325 for the full context.
  • Loading branch information
mikewallace1979 committed Jul 27, 2021
1 parent f26ac2a commit df80f8b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
6 changes: 4 additions & 2 deletions barman/clients/cloud_walarchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,17 @@ def parse_arguments(args=None):
compression.add_argument(
"-z",
"--gzip",
help="gzip-compress the WAL while uploading to the cloud",
help="gzip-compress the WAL while uploading to the cloud "
"(should not be used with python < 3.2)",
action="store_const",
const="gzip",
dest="compression",
)
compression.add_argument(
"-j",
"--bzip2",
help="bzip2-compress the WAL while uploading to the cloud",
help="bzip2-compress the WAL while uploading to the cloud "
"(should not be used with python < 3.3)",
action="store_const",
const="bzip2",
dest="compression",
Expand Down
16 changes: 10 additions & 6 deletions doc/barman-cloud-wal-archive.1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ This script can be used in the \f[C]archive_command\f[] of a PostgreSQL
server to ship WAL files to the Cloud.
Currently AWS S3 and Azure Blob Storage are supported.
.PP
Note: If you are running python 2 or older unsupported versions of
python 3 then avoid the compression options \f[C]--gzip\f[R] or
\f[C]--bzip2\f[R] as barman-cloud-wal-restore is unable to restore
gzip-compressed WALs on python < 3.2 or bzip2-compressed WALs on python
< 3.3.
.PP
This script and Barman are administration tools for disaster recovery of
PostgreSQL servers written in Python and maintained by EnterpriseDB.
.SH POSITIONAL ARGUMENTS
Expand Down Expand Up @@ -64,14 +70,12 @@ test connectivity to the cloud destination and exit
.RE
.TP
.B \-z, \[en]gzip
gzip\-compress the WAL while uploading to the cloud
.RS
.RE
gzip-compress the WAL while uploading to the cloud (should not be used
with python < 3.2)
.TP
.B \-j, \[en]bzip2
bzip2\-compress the WAL while uploading to the cloud
.RS
.RE
bzip2-compress the WAL while uploading to the cloud (should not be used
with python < 3.3)
.TP
.B \[en]cloud\-provider {aws\-s3,azure\-blob\-storage}
the cloud provider to which the backup should be uploaded
Expand Down
7 changes: 7 additions & 0 deletions doc/barman-cloud-wal-archive.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ This script can be used in the `archive_command` of a PostgreSQL
server to ship WAL files to the Cloud. Currently AWS S3 and Azure Blob
Storage are supported.

Note: If you are running python 2 or older unsupported versions of
python 3 then avoid the compression options `--gzip` or `--bzip2` as
barman-cloud-wal-restore is unable to restore gzip-compressed WALs
on python < 3.2 or bzip2-compressed WALs on python < 3.3.

This script and Barman are administration tools for disaster recovery
of PostgreSQL servers written in Python and maintained by EnterpriseDB.

Expand Down Expand Up @@ -55,9 +60,11 @@ WAL_PATH

-z, --gzip
: gzip-compress the WAL while uploading to the cloud
(should not be used with python < 3.2)

-j, --bzip2
: bzip2-compress the WAL while uploading to the cloud
(should not be used with python < 3.3)

--cloud-provider {aws-s3,azure-blob-storage}
: the cloud provider to which the backup should be uploaded
Expand Down

0 comments on commit df80f8b

Please sign in to comment.