Notable changes
-
Support for WarehousePG
Barman now supports backing up and restoring WarehousePG instances,
including backups to cloud object storage.Barman detects WarehousePG instances automatically and saves their
gp_dbidandgp_server_version_numin the backup metadata, which
barman show-backupdisplays. Thewarehousepg_dbidconfiguration option
is deprecated and no longer has any effect, as Barman now infers the
database id from the instance it is connected to. It should be removed from
the configuration.WarehousePG stores the data of a tablespace in a directory named after the
dbidof the instance, inside the tablespace location. Barman supports this
layout in rsync and cloud backups, andbarman restoreand
barman-cloud-restorelink the restored tablespaces to that directory.
Backups and restores of other PostgreSQL instances are not affected.Barman also reports the WAL retention setting of WarehousePG 7 in
barman show-server, and concurrent restores that share a tablespace
location no longer fail.The documentation has a new WarehousePG page with the details.
References: BAR-1634, BAR-1640, BAR-1641, BAR-1643, BAR-1660, BAR-1663.
Minor changes
-
barman check-backupnow exits with an error for backups waiting for WALsPreviously,
barman check-backupexited with0and printed nothing when
the backup wasWAITING_FOR_WALS, so callers could not tell that the backup
consistency had not been verified yet.The command now prints an error message and exits with code
1in that
case. It exits with0only forDONEbackups, and with1forFAILED
orWAITING_FOR_WALSbackups, or when the check could not be performed,
for example because another process holds the backup lock. The exit codes
are documented in the command reference.Behavior change: scripts that run
barman check-backupand expect0
for backups still waiting for WALs must handle the new exit code. The
periodic checks run bybarman cronare not affected.References: BAR-1633.
-
Add
--remote-barman-pathtobarman-wal-archiveandbarman-wal-restorebarman-wal-archiveandbarman-wal-restorenow accept the
--remote-barman-pathoption, which sets the directory containing thebarman
executable on the Barman server. This allows using the clients whenbarmanis
not in thePATH. When it is not set, the clients keep callingbarmanfrom the
PATH, so existing setups are unaffected.References: BAR-1639.
-
Fix inactive servers modifying the shared backup catalog
Barman 3.20.0 allowed
check-backupandkeepto run on inactive servers
(active = false), anddeletewas also allowed. That is only safe when the
inactive server owns its backup catalog. When several Barman installations
share the same cloud bucket, and an inactive one does not own the catalog,
these commands could:- overwrite the status of a backup in the shared catalog with
check-backup.
A check that saw a different set of WAL files could mark a good backup as
FAILEDfor every installation. - write keep annotations to the shared bucket with
keep. - delete a backup that was marked to be kept by the installation that owns
it withdelete, as that keep annotation was not taken into account.
check-backup,keepanddeleteare now skipped on inactive servers, as
check-backupandkeepwere before 3.20.0. Read-only and diagnostic
commands,restore,get-wal,cloud-wal-restoreandterminate-process
remain available.References: BAR-1645.
- overwrite the status of a backup in the shared catalog with
Bugfixes
-
Fix unrelated directories being included in cloud backups of tablespaces
When taking a backup to cloud object storage, Barman only intends to back
up thePG_<major>_*directory of each tablespace. However, directories
inside the tablespace location could still be included in the tablespace backup.
This caused undesired behaviors, such as when tablespace located inside PGDATA
would have its contents duplicated in the backup.Barman now correctly handles tablespace directories, ensuring that only the
intendedPG_<major>_*directories are included in the backup.References: BAR-1635.
-
Fix WAL existence checks for cloud WAL storage when compression differs
When WALs are stored in cloud storage,
check-backup,
check-archived-wal-rangeand the wait for WALs to be archived (as in
switch-wal --archiveandbackup --wait) looked for each WAL using the
extension of thecompressioncurrently configured for the server. WALs
archived with a different compression, or none, were wrongly reported as
missing. This happened, for example, whencompressionwas changed after
some WALs had been archived. In the case ofcheck-backup, healthy backups
were marked asFAILED.These commands now find the WAL regardless of its compression, as
barman cloud-wal-restorealready does.References: BAR-1628.
-
Fix backups to Google Cloud Storage failing on Python 3.14
When running on Python 3.14, backups to Google Cloud Storage failed as soon
as Barman started uploading data, even with a single upload job, with the
errorBackup failed uploading data (Pickling client objects is explicitly not supported.).This happened because Python 3.14 changed the default way subprocesses are
started on Linux, fromforktoforkserver, which the Google Cloud
Storage upload code was not compatible with. This issue is now fixed.Special thanks to @dpippenger who reported and contributed to this fix in
the PR #1236.References: BAR-1670.
-
Fix parallel WAL archiving failing on Python 3.14
When running on Python 3.14, archiving WAL files in parallel did not work.
The additional WAL files requested through the--paralleloption of
barman cloud-wal-archive(or through thecloud_wal_archive_parallel
server option) could not be archived, because the worker processes failed
to start with aTypeErrormentioningCsvOption.__init__().This happened because Python 3.14 changed how new processes are started on
Linux, fromforktoforkserver. Barman now explicitly starts the worker
processes with theforkstart method, ensuring compatibility with Python 3.14.References: BAR-1646.
-
Fix Barman not deleting compressed WAL files from cloud storage
When using the
local-to-cloudbackup method, or thepostgresbackup
method withs3://URLs forwals_directory, Barman silently failed to delete
compressed WAL files from the cloud storage when applying retention policies,
leaving unneeded files in the storage forever.The issue is fixed for WAL files archived after upgrading. WAL files that
were archived by earlier versions are still recorded without their
compression in the WAL catalog, so Barman is still unable to delete them.
Those files have to be removed manually from the cloud storage.Note: this bug only affects Barman servers running with backup method
local-to-cloud
orpostgreswiths3://URLs forwals_directory.References: BAR-1629.
-
Fix delta restore removing unrelated content from tablespace locations
A delta restore removed everything in a tablespace location that was not part
of the backup. This included content that belongs to something else, such as the
directory of the old Postgres major version left in the location by
pg_upgrade.
Now only the extra files within the backup's own tablespace directory
(PG_<major>_<catversion>) are removed, and any other content in the location
is kept.References: BAR-1637.
-
Reject delta restore of cloud backups to a local destination
When restoring a backup stored in cloud storage to a local destination,
Barman accepted--delta-restore(ordelta-restoreinrecovery_options)
without performing an actual delta restore. Delta restores are not possible
for local restores of cloud backups at the moment.barman restorenow exits with an error in that case, as it already does
for local restores of incremental, compressed or encrypted backups. Restores
of cloud backups to a remote destination are not affected.If
delta-restoreis set inrecovery_options, use--no-delta-restoreto
restore cloud backups locally.References: BAR-1636.
-
Fix local restore of cloud backups overwriting backup.info in cloud storage
When restoring a backup stored in cloud storage to a local directory, Barman
uploaded a copy of thebackup.infofile back to the bucket, replacing the
catalog object. As a consequence,barman restorerequired write access to
the bucket, and restores performed from a second Barman instance reading the
same catalog would write to the catalog of the primary site.Barman now only updates
backup.infoin cloud storage when the backup
catalog itself is modified. Restores no longer write to the bucket.This issue was introduced in Barman 3.19.0.
References: BAR-1630.
-
Fix
FileNotFoundErrortraceback printed at exit bybarman-cloud-backupon Python 3.13+On Python 3.13 and later,
barman-cloud-backupprinted aFileNotFoundError
traceback at exit after a successful backup, causing confusion for users. The
backup itself was not affected. This was caused by a temporary directory being
removed twice after some behavior changes of Python 3.13.This has been fixed, and the traceback is no longer printed.
Contribution from @Muhtasim-Munif-Fahim.
References: BAR-1673.
-
Resolve backup names for backups in any status
Backup names given to
barman backup --namewere only resolved for backups
inWAITING_FOR_WALSorDONEstatus. ForSTARTEDandFAILEDbackups,
commands such asdelete,show-backupandcheck-backupfailed with
Unknown backup, althoughlist-backupshowed the name and the same
commands worked with the backup ID. This made it hard to clean up failed
backups by name.Backup names now resolve for backups in any status, as backup IDs do.
Commands which require a usable backup, such asrestore, keep checking
the backup status and report an error for backups that cannot be used.As before, if more than one backup has the same name, commands fail with
an error listing the IDs of the matching backups, and the backup ID must be
used instead. This now also takesSTARTEDandFAILEDbackups into
account, for example when a failed backup is retried using the same name.References: BAR-1638.