cancel
Showing results for 
Search instead for 
Did you mean: 

Why is BART Incremental backup non-zero in size?

The incremental backup taken without any further activity on the cluster, it will not be zero in size despite not generating any new WALs. Incremental backup is non-zero in size for a below-mentioned reason:

The incremental backup process identifies which WAL files may contain changes from when the parent backup was taken at the starting point of the incremental backup. The corresponding MBM files are used to locate and copy the modified blocks to the incremental backup directory along with other database cluster directories and files. Instead of backing up all, full relation files, only the modified blocks are copied and saved. In addition, the relevant MBM files are condensed into one consolidated block map (CBM) file that is stored with the incremental backup.

Below are the high-level steps performed by BART during an incremental backup

1. Checks the Log sequence number of the parent backup and the current backup
2. Checks the MBM files that are created in the archived_wal location that are required
3. Copies the modified blocks to the incremental backup directory along with other database cluster directories and files.
4. Creates CBM file in incremental backup directory, which contains all the relevent MBM files
5. Copies the WAL files generated during this backup to archived_wals location

Please refer below link for more details:

https://www.enterprisedb.com/docs/en/2.2/BART_Guide_2.2/EDB_Postgres_Backup_and_Recovery_Guide.1.10.... (Step 5)

e.g.

-bash-4.1$ ./bart -d BACKUP -s epas10 --backup-name full1
INFO:  DebugTarget - getVar(checkDiskSpace.bytesAvailable)
DEBUG: total number of worker threads 5
DEBUG: starting LSN of current backup 24000000 (expected WAL 000000010000000000000024)
DEBUG: computed start/stop LSN values: 146 msecs
INFO:  new backup identifier generated 1546110302284
DEBUG: created image directories: 0 msecs
DEBUG: queued data directory (except relation files): 42 msecs
INFO:  creating 5 harvester threads
DEBUG: quitting thread :3
DEBUG: quitting thread :4
DEBUG: quitting thread :2
DEBUG: quitting thread :0
DEBUG: quitting thread :1
DEBUG: terminating block-copy threads
DEBUG: terminating block-copy threads
DEBUG: terminating block-copy threads
DEBUG: terminating block-copy threads
DEBUG: terminating block-copy threads
NOTICE:  pg_stop_backup complete, all required WAL segments have been archived
/tmp/backups/epas10/1546110302284
/tmp/backups/epas10/1546110302284
DEBUG: start time: 1546110302, stop time: 1546110303, duration: 1
INFO:  backup completed successfully
INFO:  
BART VERSION: 2.2.0
BACKUP DETAILS:
BACKUP STATUS: active
BACKUP IDENTIFIER: 1546110302284
BACKUP NAME: full1
BACKUP PARENT: none
BACKUP LOCATION: /tmp/backups/epas10/1546110302284
BACKUP SIZE: 80.55 MB
BACKUP FORMAT: tar
BACKUP TIMEZONE: US/Pacific
XLOG METHOD: fetch
BACKUP CHECKSUM(s): 0
TABLESPACE(s): 0
START WAL LOCATION: 000000010000000000000024
STOP WAL LOCATION: 000000010000000000000025
BACKUP METHOD: pg_start_backup
BACKUP FROM: master
START TIME: 2018-12-29 11:05:02 PST
STOP TIME: 2018-12-29 11:05:03 PST
TOTAL DURATION: 1 sec(s)

DEBUG: backup complete: 2540 msecs
DEBUG: exit status for process 508: 0 (happy)

-bash-4.1$ ./bart -d BACKUP -s epas10 --backup-name inc1_full1 --parent full1 -F p
INFO:  DebugTarget - getVar(checkDiskSpace.bytesAvailable)
DEBUG: total number of worker threads 5
DEBUG: starting LSN of parent backup  24000028
DEBUG: starting LSN of current backup 27000000 (expected WAL 000000010000000000000027)
DEBUG: computed start/stop LSN values: 151 msecs
INFO:  checking /tmp/backups/epas10/archived_wals for MBM files from 0/24000028 to 0/27000000
DEBUG: waited for MBM files: 30 msecs
INFO:  new backup identifier generated 1546110332820
DEBUG: created tablespace layout: 6 msecs
DEBUG: created image directories: 6 msecs
DEBUG: queued data directory (except relation files): 18 msecs
INFO:  creating 5 harvester threads
DEBUG: reading 0000000100000000240000280000000025000000.mbm
DEBUG: reading 0000000100000000250000280000000026000000.mbm
DEBUG: reading 0000000100000000260000280000000027000000.mbm
DEBUG: reading 0000000100000000270000280000000028000000.mbm
DEBUG: CBM produced: /tmp/backups/epas10/1546110332820/1546110332820.cbm
DEBUG: quitting thread :1
DEBUG: quitting thread :4
DEBUG: quitting thread :3
DEBUG: quitting thread :2
DEBUG: quitting thread :0
DEBUG: terminating block-copy threads
DEBUG: terminating block-copy threads
DEBUG: terminating block-copy threads
DEBUG: terminating block-copy threads
DEBUG: terminating block-copy threads
NOTICE:  pg_stop_backup complete, all required WAL segments have been archived
DEBUG: copying wals cmd: cp /tmp/backups/epas10/archived_wals/000000010000000000000027 /tmp/backups/epas10/1546110332820/base/pg_wal/
DEBUG: copying wals cmd: cp /tmp/backups/epas10/archived_wals/000000010000000000000028 /tmp/backups/epas10/1546110332820/base/pg_wal/
DEBUG: start time: 1546110332, stop time: 1546110333, duration: 1
INFO:  backup completed successfully
INFO:  
BART VERSION: 2.2.0
BACKUP DETAILS:
BACKUP STATUS: active
BACKUP IDENTIFIER: 1546110332820
BACKUP NAME: inc1_full1
BACKUP PARENT: 1546110302284
BACKUP LOCATION: /tmp/backups/epas10/1546110332820
BACKUP SIZE: 39.31 MB
BACKUP FORMAT: plain
BACKUP TIMEZONE: US/Pacific
XLOG METHOD: fetch
BACKUP CHECKSUM(s): 0
TABLESPACE(s): 0
START WAL LOCATION: 000000010000000000000027
STOP WAL LOCATION: 000000010000000000000028
BACKUP METHOD: pg_start_backup
BACKUP FROM: master
START TIME: 2018-12-29 11:05:32 PST
STOP TIME: 2018-12-29 11:05:33 PST
TOTAL DURATION: 1 sec(s)

DEBUG: backup complete: 1577 msecs
DEBUG: exit status for process 560: 0 (happy)

epas10        1546110332820   inc1_full1    full1           2018-12-29 11:05:33 PST   39.32 MB                                active  
 epas10        1546110302284   full1         none            2018-12-29 11:05:04 PST   80.55 MB      176.00 MB     11          active  
 

Version history
Revision #:
4 of 6
Last update:
‎02-19-2019 05:58 AM
Updated by:
 
Labels (2)