Hi JK,
Yes, your understanding is correct.
When backups are taken using
backup_method = postgres, Barman invokes
pg_basebackup with the
--wal-method=none option (i.e.,
-X none). You can see this in the source code here:
https://github.com/EnterpriseDB/barman/blob/master/barman/command_wrappers.py#L962-L969.
In this setup, Barman relies on either the
archive_command or
pg_receivewal (depending on your configuration) to archive WAL files from the Postgres server to the Barman server.
Periodically,
barman cron runs and checks whether all the WALs required for backup consistency have been received. Once they are, Barman changes the backup status from
WAITING_FOR_WALS to
DONE (see https://github.com/EnterpriseDB/barman/blob/master/barman/backup.py#L1847-L1852).
As you noticed, if there's little or no activity on the PostgreSQL server, it can take some time for the final WAL segment (needed to complete the backup) to be switched, delaying the status update in Barman.
If you prefer to complete the backup sooner, it’s safe to manually run
barman switch-wal at the end of your backup process. This can help ensure the backup is marked as
DONE without waiting for natural WAL activity in Postgres.
Best regards,
Israel.