Skip to content

feat(backup): allow zstd compression for base backups - #1144

Closed
dgsardina wants to merge 2 commits into
cloudnative-pg:mainfrom
dgsardina:dev/1104
Closed

dgsardina wants to merge 2 commits into
cloudnative-pg:mainfrom
dgsardina:dev/1104

Conversation

@dgsardina

@dgsardina dgsardina commented Oct 5, 2026 •

Copy link
Copy Markdown

Upgrade the barman-cloud library to a version that includes
cloudnative-pg/barman-cloud#310, which adds zstd to the
DataBackupConfiguration.compression enum. Regenerate the ObjectStore
CRD and the release manifest, and update the compression docs so that
zstd is no longer listed as WAL-only.

Barman 3.20.0 added --zstd to barman-cloud-backup; the sidecar image
already ships barman 3.20.1 with the zstandard extra, and
barman-cloud-restore picks the decompressor from the .tar.zst suffix
of the uploaded object, so no plugin code changes are needed.

The library bump also pulls in s3AddressingStyle
(cloudnative-pg/barman-cloud#288), which therefore appears in the CRD.

feat(api): expose s3AddressingStyle from barman-cloud (cloudnative-pg/barman-cloud#288)

Closes #1104

The pseudo-version can be replaced with v0.7.0 once cloudnative-pg/barman-cloud#303 is merged; renovate will do that automatically.

Upgrade the barman-cloud library to a version that includes
cloudnative-pg/barman-cloud#310, which adds `zstd` to the
`DataBackupConfiguration.compression` enum. Regenerate the ObjectStore
CRD and the release manifest, and update the compression docs so that
`zstd` is no longer listed as WAL-only.

Barman 3.20.0 added `--zstd` to `barman-cloud-backup`; the sidecar image
already ships barman 3.20.1 with the `zstandard` extra, and
`barman-cloud-restore` picks the decompressor from the `.tar.zst` suffix
recorded in `backup.info`, so no plugin code changes are needed.

The library bump also pulls in `s3AddressingStyle`
(cloudnative-pg/barman-cloud#288), which therefore appears in the CRD.

Closes cloudnative-pg#1104

Signed-off-by: Daniel Garcia Sardina <dgsardina@navarino.gr>

@joao00001 joao00001 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on kind (CNPG 1.28.1, plugin release manifest with the CRD from this PR applied on top, RustFS from hack/object-store):

  • the release CRD rejects data.compression: zstd, the PR CRD accepts it;
  • a backup produced base//data.tar.zst (6.38 MB vs 6.97 MB for gzip on the same 39 MB cluster), WALs in .zst;
  • a new cluster bootstrapped from it via bootstrap.recovery came up healthy with identical data (row count and md5 match).

One nit on the description: backup.info reports compression=None for both the zstd and the gzip backup, so barman-cloud-restore infers the decompressor from the object suffix, not from a value recorded in backup.info. Behaviour is correct, just the wording.
As a side note, the library bump also brings s3AddressingStyle into the CRD; since the commit message only mentions zstd, it won’t show up in the release-please changelog.

@joao00001 joao00001 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested again against the latest stable CNPG (1.30.1), same results.

@dgsardina

Copy link
Copy Markdown
Author

Thanks for testing on both CNPG versions. You're right on both counts: backup.info carries no compression value and the decompressor is inferred from the object suffix, so I've fixed that sentence in the description. I've also added a feat(api) line for s3AddressingStyle so it shows up in the changelog on squash.

@dgsardina

Copy link
Copy Markdown
Author

Superseded by #1174, which bumped barman-cloud to v0.7.0 and regenerated the CRD and manifest, so zstd is now accepted for base backups on main. I'll open a small follow-up for the compression docs, which still list zstd as WAL-only, and link it to #1104.

@dgsardina dgsardina closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

data.compression rejects zstd although barman-cloud-backup supports it

2 participants