ARCHIVE Mode
ARCHIVE is the default WAL delivery mode.
For example, to make a FULL backup in ARCHIVE mode, run:
pg_probackup backup -Bbackup_dir
--instanceinstance_name
-b FULL
ARCHIVE backups rely on continuous archiving to get WAL segments required to restore the cluster to a consistent state at the time the backup was taken.
When a backup is taken, pg_probackup ensures that WAL files containing WAL records between Start LSN
and Stop LSN
actually exist in
directory. pg_probackup also ensures that WAL records between backup_dir
/wal/instance_name
Start LSN
and Stop LSN
can be parsed. This precaution eliminates the risk of silent WAL corruption.
STREAM Mode
STREAM is the optional WAL delivery mode.
For example, to make a FULL backup in the STREAM mode, add the --stream
flag to the command from the previous example:
pg_probackup backup -Bbackup_dir
--instanceinstance_name
-b FULL --stream --temp-slot
The optional --temp-slot
flag ensures that the required segments remain available if the WAL is rotated before the backup is complete.
Unlike backups in ARCHIVE mode, STREAM backups include all the WAL segments required to restore the cluster to a consistent state at the time the backup was taken.
During backup pg_probackup streams WAL files containing WAL records between Start LSN
and Stop LSN
to
directory. To eliminate the risk of silent WAL corruption, pg_probackup also checks that WAL records between backup_dir
/backups/instance_name
/backup_id
/database/pg_walStart LSN
and Stop LSN
can be parsed.
Even if you are using continuous archiving, STREAM backups can still be useful in the following cases:
-
STREAM backups can be restored on the server that has no file access to WAL archive.
-
STREAM backups enable you to restore the cluster state at the point in time for which WAL files in archive are no longer available.
-
Backup in STREAM mode can be taken from a standby of a server that generates small amount of WAL traffic, without long waiting for WAL segment to fill up.