Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit837534f

Browse files
committed
Documentation: added "ARCHIVE mode" section
1 parent833f31d commit837534f

File tree

1 file changed

+31
-20
lines changed

1 file changed

+31
-20
lines changed

‎Documentation.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ Current version - 2.1.3
77
1.[Synopsis](#synopsis)
88
2.[Versioning](#versioning)
99
3.[Overview](#overview)
10-
*[Backup modes](#backup-modes)
11-
*[WAL methods](#wal-methods)
1210
*[Limitations](#limitations)
1311

1412
4.[Installation and Setup](#installation-and-setup)
@@ -129,22 +127,18 @@ As compared to other backup solutions, pg_probackup offers the following benefit
129127

130128
To manage backup data, pg_probackup creates a`backup catalog`. This is a directory that stores all backup files with additional meta information, as well as WAL archives required for point-in-time recovery. You can store backups for different instances in separate subdirectories of a single backup catalog.
131129

132-
###Backup Modes
133-
134-
Using pg_probackup, you can take full or incremental backups:
130+
Using pg_probackup, you can take full or incremental[backups](#creating-a-backup):
135131

136132
- FULL backups contain all the data files required to restore the database cluster.
137133
- Incremental backups only store the data that has changed since the previous backup. It allows to decrease the backup size and speed up backup and restore operations. pg_probackup supports the following modes of incremental backups:
138134
- DELTA backup. In this mode, pg_probackup reads all data files in the data directory and copies only those pages that has changed since the previous backup. Note that this mode can impose read-only I/O pressure equal to a full backup.
139135
- PAGE backup. In this mode, pg_probackup scans all WAL files in the archive from the moment the previous full or incremental backup was taken. Newly created backups contain only the pages that were mentioned in WAL records. This requires all the WAL files since the previous backup to be present in the WAL archive. If the size of these files is comparable to the total size of the database cluster files, speedup is smaller, but the backup still takes less space. You have to configure WAL archiving as explained in the section[Setting up continuous WAL archiving](#setting-up-continuous-wal-archiving) to make PAGE backups.
140136
- PTRACK backup. In this mode, PostgreSQL tracks page changes on the fly. Continuous archiving is not necessary for it to operate. Each time a relation page is updated, this page is marked in a special PTRACK bitmap for this relation. As one page requires just one bit in the PTRACK fork, such bitmaps are quite small. Tracking implies some minor overhead on the database server operation, but speeds up incremental backups significantly.
141137

142-
###WAL methods
143-
144-
pg_probackup can take only physical online backups, and online backups require WAL for consistent recovery. So regardless of the chosen[backup mode](#backup-modes) (FULL, PAGE or DELTA), any backup taken with pg_probackup must use one of the following`WAL delivery methods`:
138+
pg_probackup can take only physical online backups, and online backups require WAL for consistent recovery. So regardless of the chosen backup mode (FULL, PAGE or DELTA), any backup taken with pg_probackup must use one of the following`WAL delivery methods`:
145139

146-
- ARCHIVE. Such backups rely on[continuous archiving](#setting-up-continuous-wal-archiving) to ensure consistent recovery. This is the default WAL delivery method.
147-
- STREAM. Such backups include all the files required to restore the cluster to a consistent state at the time the backup was taken. Regardless of[continuous archiving](#setting-up-continuous-wal-archiving) been set up or not, the WAL segments required for consistent recovery are streamed (hence STREAM) via replication protocol during backup and included into the backup files.
140+
-[ARCHIVE](#archive-mode). Such backups rely on[continuous archiving](#setting-up-continuous-wal-archiving) to ensure consistent recovery. This is the default WAL delivery method.
141+
-[STREAM](#stream-mode). Such backups include all the files required to restore the cluster to a consistent state at the time the backup was taken. Regardless of[continuous archiving](#setting-up-continuous-wal-archiving) been set up or not, the WAL segments required for consistent recovery are streamed (hence STREAM) via replication protocol during backup and included into the backup files.
148142

149143
###Limitations
150144

@@ -889,31 +883,48 @@ Where *backup_mode* can take one of the following values:
889883
- PAGE — creates an incremental PAGE backup based on the WAL files that have changed since the previous full or incremental backup was taken.
890884
- PTRACK — creates an incremental PTRACK backup tracking page changes on the fly.
891885

892-
When restoring a cluster from an incremental backup, pg_probackup relies on theprevious full backupto restoreall thedata files first. Thus, you must create at least one full backup before taking incremental ones.
886+
When restoring a cluster from an incremental backup, pg_probackup relies on theparent full backupandall theincremental backups between them, which is called`backup chain`. You must create at least one full backup before taking incremental ones.
893887

894-
####Page validation
895-
If[data checksums](https://www.postgresql.org/docs/current/runtime-config-preset.html#GUC-DATA-CHECKSUMS) are enabled in the database cluster, pg_probackup uses this information to check correctness of data files. While reading each page, pg_probackup checks whether the calculated checksum coincides with the checksum stored in the page header. This guarantees that the PostgreSQL instance and backup itself are free of corrupted pages.
896-
Note that pg_probackup reads database files directly from filesystem, so under heavy write load during backup it can show false positive checksum failures because of partial writes. In case of page checksumm mismatch, page is readed again and checksumm comparison repeated.
888+
####ARCHIVE mode
897889

898-
Page isconsidered corrupted if checksumm comparison failed more than 100 times, is this case backup is aborted.
890+
ARCHIVE isthe default WAl delivery mode.
899891

900-
Redardless of data checksums been enabled or not, pg_probackup always check page header "sanity".
892+
For example, to make a FULL backup in ARCHIVE mode, run:
893+
894+
pg_probackup backup -B backup_dir --instance instance_name -b FULL
895+
896+
ARCHIVE backup rely on[continuous archiving](#setting-up-continuous-wal-archiving) to provide WAL segments required to restore the cluster to a consistent state at the time the backup was taken.
897+
898+
During[backup](#backup) pg_probackup ensures that WAL files containing WAL records between START LSN and STOP LSN are actually exists in '*backup_dir*/wal/*instance_name*' directory. Also pg_probackup ensures that WAL records between START LSN and STOP LSN can be parsed. This costly precations eliminates the risk of silent WAL corruption.
901899

902900
####STREAM mode
903-
To make a STREAM backup, add the`--stream` option to the above command. For example, to create a full STREAM backup, run:
901+
902+
STREAM is the optional WAl delivery mode.
903+
904+
For example, to make a FULL backup in STREAM mode, add the`--stream` option to the command from the previous example:
904905

905906
pg_probackup backup -B backup_dir --instance instance_name -b FULL --stream --temp-slot
906907

907-
The optional`--temp-slot` parameter ensures that the required segments remain available if the WAL is rotated before the backup is complete.
908+
The optional`--temp-slot` flag ensures that the required segments remain available if the WAL is rotated before the backup is complete.
909+
910+
STREAM backups include all the WAL segments required to restore the cluster to a consistent state at the time the backup was taken.
908911

909-
STREAM backups include all theWALsegments required to restore the cluster to a consistent state at the time the backup was taken. To restore a cluster from an incremental STREAM backup, pg_probackup still requires the full backup and alltheincremental backups it depends on.
912+
During[backup](#backup) pg_probackup streamsWALfiles containing WAL records between START LSN and STOP LSN in '*backup_dir*/backups/*instance_name*/*BACKUP ID*/database/pg_wal' directory. Also pg_probackup ensures that WAL records between START LSN and STOP LSN can be parsed. This costly precations eliminatestherisk of silent WAL corruption.
910913

911914
Even if you are using[continuous archiving](#setting-up-continuous-wal-archiving), STREAM backups can still be useful in the following cases:
912915

913916
- STREAM backups can be restored on the server that has no file access to WAL archive.
914917
- STREAM backups enable you to restore the cluster state at the point in time for which WAL files are no longer available.
915918
- Backup in STREAM mode can be taken from standby of a server, that generates small amount of WAL traffic, without long waiting for WAL segment to fill up.
916919

920+
####Page validation
921+
If[data checksums](https://www.postgresql.org/docs/current/runtime-config-preset.html#GUC-DATA-CHECKSUMS) are enabled in the database cluster, pg_probackup uses this information to check correctness of data files during backup. While reading each page, pg_probackup checks whether the calculated checksum coincides with the checksum stored in the page header. This guarantees that the PostgreSQL instance and backup itself are free of corrupted pages.
922+
Note that pg_probackup reads database files directly from filesystem, so under heavy write load during backup it can show false positive checksum failures because of partial writes. In case of page checksumm mismatch, page is readed again and checksumm comparison repeated.
923+
924+
Page is considered corrupted if checksumm comparison failed more than 100 times, is this case backup is aborted.
925+
926+
Redardless of data checksums been enabled or not, pg_probackup always check page header "sanity".
927+
917928
####External directories
918929
To back up a directory located outside of the data directory, use the optional`--external-dirs` parameter that specifies the path to this directory. If you would like to add more than one external directory, provide several paths separated by colons.
919930

@@ -1030,7 +1041,7 @@ The typical workflow is as follows:
10301041

10311042
- On your backup host, configure pg_probackup as explained in the section[Installation and Setup](#installation-and-setup). For the[add-instance](#add-instance) and[set-config](#set-config) commands, make sure to specify[remote options](#remote-mode-options) that point to the database host with the PostgreSQL instance.
10321043

1033-
- If you would like to take remote backup in[PAGE](#backup-modes) mode, or rely on[ARCHIVE](#wal-methods) WAL delivery method, or use[PITR](#performing-point-in-time-pitr-recovery), then configure continuous WAL archiving from database host to the backup host as explained in the section[Setting up continuous WAL archiving](#setting-up-continuous-wal-archiving). For the[archive-push](#archive-push) and[archive-get](#archive-get) commands, you must specify the[remote options](#remote-mode-options) that point to backup host with backup catalog.
1044+
- If you would like to take remote backup in[PAGE](#creating-a-backup) mode, or rely on[ARCHIVE](#archive-mode) WAL delivery method, or use[PITR](#performing-point-in-time-pitr-recovery), then configure continuous WAL archiving from database host to the backup host as explained in the section[Setting up continuous WAL archiving](#setting-up-continuous-wal-archiving). For the[archive-push](#archive-push) and[archive-get](#archive-get) commands, you must specify the[remote options](#remote-mode-options) that point to backup host with backup catalog.
10341045

10351046
- Run[backup](#backup) or[restore](#restore) commands with[remote options](#remote-mode-options) on backup host. pg_probackup connects to the remote system via SSH and creates a backup locally or restores the previously taken backup on the remote system, respectively.
10361047

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp