EnterpriseDB / barman

Barman - Backup and Recovery Manager for PostgreSQL
https://www.pgbarman.org/
GNU General Public License v3.0
2.14k stars 193 forks source link

Get database cluster size and add to `backup.info` #966

Closed andremagui closed 3 months ago

andremagui commented 3 months ago

After the introduction of incremental backups in Postgres 17, there is the need to review how we display information about backups, specially when using the show-backup command. Because of this need, we are adding the cluster size field to the backup.info. This new field is intended to be used in the calculation of the deduplication_ratio of backups and to show the estimated size of the Postgres cluster at the time the backup was taken. For this, we are reusing an existing property of the PostgreSQLConnection class called current_size.

The tests broken by the changes on the code were fixed.

Unit tests for the current_size property were added because they were found to missing from the test suite and the unit test for the _pg_get_metadata method of the BackupStrategy class was extended because of the changes in the method.

References: BAR-215