Skip to content

Release 3.21.0

Latest

Choose a tag to compare

@joao00001 joao00001 released this 18 Nov 01:05
release/3.21.0

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_dbid and gp_server_version_num in the backup metadata, which
    barman show-backup displays. The warehousepg_dbid configuration 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
    dbid of the instance, inside the tablespace location. Barman supports this
    layout in rsync and cloud backups, and barman restore and
    barman-cloud-restore link 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-backup now exits with an error for backups waiting for WALs

    Previously, barman check-backup exited with 0 and printed nothing when
    the backup was WAITING_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 1 in that
    case. It exits with 0 only for DONE backups, and with 1 for FAILED
    or WAITING_FOR_WALS backups, 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-backup and expect 0
    for backups still waiting for WALs must handle the new exit code. The
    periodic checks run by barman cron are not affected.

    References: BAR-1633.

  • Add --remote-barman-path to barman-wal-archive and barman-wal-restore

    barman-wal-archive and barman-wal-restore now accept the
    --remote-barman-path option, which sets the directory containing the barman
    executable on the Barman server. This allows using the clients when barman is
    not in the PATH. When it is not set, the clients keep calling barman from the
    PATH, so existing setups are unaffected.

    References: BAR-1639.

  • Fix inactive servers modifying the shared backup catalog

    Barman 3.20.0 allowed check-backup and keep to run on inactive servers
    (active = false), and delete was 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
      FAILED for 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 with delete, as that keep annotation was not taken into account.

    check-backup, keep and delete are now skipped on inactive servers, as
    check-backup and keep were before 3.20.0. Read-only and diagnostic
    commands, restore, get-wal, cloud-wal-restore and terminate-process
    remain available.

    References: BAR-1645.

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 the PG_<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
    intended PG_<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-range and the wait for WALs to be archived (as in
    switch-wal --archive and backup --wait) looked for each WAL using the
    extension of the compression currently configured for the server. WALs
    archived with a different compression, or none, were wrongly reported as
    missing. This happened, for example, when compression was changed after
    some WALs had been archived. In the case of check-backup, healthy backups
    were marked as FAILED.

    These commands now find the WAL regardless of its compression, as
    barman cloud-wal-restore already 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
    error Backup 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, from fork to forkserver, 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 --parallel option of
    barman cloud-wal-archive (or through the cloud_wal_archive_parallel
    server option) could not be archived, because the worker processes failed
    to start with a TypeError mentioning CsvOption.__init__().

    This happened because Python 3.14 changed how new processes are started on
    Linux, from fork to forkserver. Barman now explicitly starts the worker
    processes with the fork start 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-cloud backup method, or the postgres backup
    method with s3:// URLs for wals_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
    or postgres with s3:// URLs for wals_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 (or delta-restore in recovery_options)
    without performing an actual delta restore. Delta restores are not possible
    for local restores of cloud backups at the moment.

    barman restore now 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-restore is set in recovery_options, use --no-delta-restore to
    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 the backup.info file back to the bucket, replacing the
    catalog object. As a consequence, barman restore required 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.info in 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 FileNotFoundError traceback printed at exit by barman-cloud-backup on Python 3.13+

    On Python 3.13 and later, barman-cloud-backup printed a FileNotFoundError
    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 --name were only resolved for backups
    in WAITING_FOR_WALS or DONE status. For STARTED and FAILED backups,
    commands such as delete, show-backup and check-backup failed with
    Unknown backup, although list-backup showed 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 as restore, 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 takes STARTED and FAILED backups into
    account, for example when a failed backup is retried using the same name.

    References: BAR-1638.