From 9a7aa008487b9cc5d016edd20b6190381fdd3bb9 Mon Sep 17 00:00:00 2001 From: Marco Nenciarini Date: Tue, 21 Apr 2026 11:44:52 +0200 Subject: [PATCH] fix: allow lz4 compression for base backups Pick up the DataBackupConfiguration enum change from cloudnative-pg/barman-cloud#216, regenerate the CRD and manifest, and drop the "(WAL only)" marker from lz4 in the compression docs. Closes #867 Signed-off-by: Marco Nenciarini --- config/crd/bases/barmancloud.cnpg.io_objectstores.yaml | 3 ++- go.mod | 2 ++ go.sum | 4 ++-- manifest.yaml | 3 ++- web/docs/compression.md | 4 +++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/config/crd/bases/barmancloud.cnpg.io_objectstores.yaml b/config/crd/bases/barmancloud.cnpg.io_objectstores.yaml index 43c675d..f63e29b 100644 --- a/config/crd/bases/barmancloud.cnpg.io_objectstores.yaml +++ b/config/crd/bases/barmancloud.cnpg.io_objectstores.yaml @@ -144,10 +144,11 @@ spec: description: |- Compress a backup file (a tar file per tablespace) while streaming it to the object store. Available options are empty string (no - compression, default), `gzip`, `bzip2`, and `snappy`. + compression, default), `gzip`, `bzip2`, `lz4`, and `snappy`. enum: - bzip2 - gzip + - lz4 - snappy type: string encryption: diff --git a/go.mod b/go.mod index 61737ae..b131813 100644 --- a/go.mod +++ b/go.mod @@ -140,3 +140,5 @@ require ( sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect sigs.k8s.io/yaml v1.6.0 // indirect ) + +replace github.com/cloudnative-pg/barman-cloud => github.com/cloudnative-pg/barman-cloud v0.5.1-0.20260421102124-68d21f378690 diff --git a/go.sum b/go.sum index f36e5f4..f936b7e 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cloudnative-pg/api v1.29.0 h1:mNx6yJ5qi+Xrjs0NYrUy6V4MlXBkVJxGKwvTJZIuTX4= github.com/cloudnative-pg/api v1.29.0/go.mod h1:bF3HI8UVVcllZ7M8CfBufnb+Us8FyQArhD+4qtX0qhM= -github.com/cloudnative-pg/barman-cloud v0.5.0 h1:DykSaX4o7ee2vyu5FQoG1RJsntHd+EIttIKZbJPlB1Q= -github.com/cloudnative-pg/barman-cloud v0.5.0/go.mod h1:SO2HzLa+GWlSIpGyxnISoJAFPIcaa/qDa33Bb3jefac= +github.com/cloudnative-pg/barman-cloud v0.5.1-0.20260421102124-68d21f378690 h1:QQGZQQByCDl/KJTIMaYHjdWNVuSNYPOPVxWy52NAFag= +github.com/cloudnative-pg/barman-cloud v0.5.1-0.20260421102124-68d21f378690/go.mod h1:XPc5IUFP1y4cZX1sg+Pd8j9V4tmUEVnv3BGCpfQOOg8= github.com/cloudnative-pg/cloudnative-pg v1.29.0 h1:49Dm8+y4va7RODspJjeaK8uMWP3OGAD0gMsxhjm16Mo= github.com/cloudnative-pg/cloudnative-pg v1.29.0/go.mod h1:0Sgb/50VyaCnQm3IbWqgnhQG8Kb6mgqo8Jo1J+KtkSI= github.com/cloudnative-pg/cnpg-i v0.5.0 h1:/TOzpNT6cwNgrpftTtrnLKdoHgMwd+88vZgXjlVgXeE= diff --git a/manifest.yaml b/manifest.yaml index 60b755e..7dedaff 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -143,10 +143,11 @@ spec: description: |- Compress a backup file (a tar file per tablespace) while streaming it to the object store. Available options are empty string (no - compression, default), `gzip`, `bzip2`, and `snappy`. + compression, default), `gzip`, `bzip2`, `lz4`, and `snappy`. enum: - bzip2 - gzip + - lz4 - snappy type: string encryption: diff --git a/web/docs/compression.md b/web/docs/compression.md index 2abbede..cfc6355 100644 --- a/web/docs/compression.md +++ b/web/docs/compression.md @@ -15,7 +15,7 @@ for space, speed, or a balance of both. - `bzip2` - `gzip` -- `lz4` (WAL only) +- `lz4` - `snappy` - `xz` (WAL only) - `zstd` (WAL only) @@ -41,3 +41,5 @@ network throughput. | bzip2 | 25,404 | 13,886 | 395 | 67 | 5.9:1 | | gzip | 116,281 | 3,077 | 395 | 91 | 4.3:1 | | snappy | 8,134 | 8,341 | 395 | 166 | 2.4:1 | + +Numbers come from a 2021 Barman proof of concept ([EnterpriseDB/barman#344](https://github.com/EnterpriseDB/barman/issues/344#issuecomment-992547396)), which predates `lz4` support for base backups. `lz4` is not yet benchmarked.