Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a3b0bd7

Browse files
committed
Documentation: update
1 parent effea35 commit a3b0bd7

File tree

1 file changed

+39
-32
lines changed

1 file changed

+39
-32
lines changed

Documentation.md

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ Current version - 2.2.1
3838
* [Managing the Backup Catalog](#managing-the-backup-catalog)
3939
* [Viewing Backup Information](#viewing-backup-information)
4040
* [Viewing WAL Archive Information](#viewing-wal-archive-information)
41-
* [Configuring Backup Retention Policy](#configuring-backup-retention-policy)
42-
* [Pinning a Backup](#pinning-a-backup)
43-
* [WAL Retention Policy](#wal-retention-policy)
41+
* [Configuring Retention Policy](#configuring-retention-policy)
42+
* [Backup Retention Policy](#backup-retention-policy)
43+
* [Backup Pinning](#backup-pinning)
44+
* [WAL Archive Retention Policy](#wal-archive-retention-policy)
4445
* [Merging Backups](#merging-backups)
4546
* [Deleting Backups](#deleting-backups)
4647

@@ -1124,7 +1125,11 @@ Most fields are consistent with plain format, with some exceptions:
11241125
- DEGRADED timelines contain 'lost-segments' array with information about intervals of missing segments. In OK timelines 'lost-segments' array is empty.
11251126
- 'N backups' attribute is replaced with 'backups' array containing backups belonging to the timeline. If timeline has no backups, then 'backups' array is empty.
11261127

1127-
### Configuring Backup Retention Policy
1128+
### Configuring Retention Policy
1129+
1130+
With pg_probackup, you can set retention policies for backups and WAL archive. All policies can be combined together in any way.
1131+
1132+
#### Backup Retention Policy
11281133

11291134
By default, all backup copies created with pg_probackup are stored in the specified backup catalog. To save disk space, you can configure retention policy and periodically clean up redundant backup copies accordingly.
11301135

@@ -1162,16 +1167,16 @@ Suppose you have backed up the *node* instance in the *backup_dir* directory, wi
11621167

11631168
```
11641169
BACKUP INSTANCE 'node'
1165-
===========================================================================================================================================
1166-
Instance Version ID Recovery time Mode WAL Current/Parent TLI Time Data Start LSN Stop LSN Status
1167-
===========================================================================================================================================
1168-
node 10 P7XDHR 2019-04-10 05:27:15+03 FULL STREAM 1 / 0 11s 200MB 0/18000059 0/18000197 OK
1169-
node 10 P7XDQV 2019-04-08 05:32:59+03 PAGE STREAM 1 / 0 11s 19MB 0/15000060 0/15000198 OK
1170-
node 10 P7XDJA 2019-04-03 05:28:36+03 DELTA STREAM 1 / 0 21s 32MB 0/13000028 0/13000198 OK
1171-
---------------------------------------retention window-------------------------------------------------------------
1172-
node 10 P7XDHU 2019-04-02 05:27:59+03 PAGE STREAM 1 / 0 31s 33MB 0/11000028 0/110001D0 OK
1173-
node 10 P7XDHB 2019-04-01 05:27:15+03 FULL STREAM 1 / 0 11s 200MB 0/F000028 0/F000198 OK
1174-
node 10 P7XDFT 2019-03-29 05:26:25+03 FULL STREAM 1 / 0 11s 200MB 0/D000028 0/D000198 OK
1170+
===================================================================================================================================
1171+
Instance Version ID Recovery time Mode WAL TLI Time Data WAL Zratio Start LSN Stop LSN Status
1172+
===================================================================================================================================
1173+
node 10 P7XDHR 2019-04-10 05:27:15+03 FULL STREAM 1/0 11s 200MB 16MB 1.0 0/18000059 0/18000197 OK
1174+
node 10 P7XDQV 2019-04-08 05:32:59+03 PAGE STREAM 1/0 11s 19MB 16MB 1.0 0/15000060 0/15000198 OK
1175+
node 10 P7XDJA 2019-04-03 05:28:36+03 DELTA STREAM 1/0 21s 32MB 16MB 1.0 0/13000028 0/13000198 OK
1176+
-------------------------------------------------------retention window--------------------------------------------------------
1177+
node 10 P7XDHU 2019-04-02 05:27:59+03 PAGE STREAM 1/0 31s 33MB 16MB 1.0 0/11000028 0/110001D0 OK
1178+
node 10 P7XDHB 2019-04-01 05:27:15+03 FULL STREAM 1/0 11s 200MB 16MB 1.0 0/F000028 0/F000198 OK
1179+
node 10 P7XDFT 2019-03-29 05:26:25+03 FULL STREAM 1/0 11s 200MB 16MB 1.0 0/D000028 0/D000198 OK
11751180
```
11761181

11771182
Even though P7XDHB and P7XDHU backups are outside the retention window, they cannot be removed as it invalidates the succeeding incremental backups P7XDJA and P7XDQV that are still required, so, if you run the [delete](#delete) command with the `--delete-expired` flag, only the P7XDFT full backup will be removed.
@@ -1183,25 +1188,25 @@ With the `--merge-expired` option, the P7XDJA backup is merged with the underlyi
11831188

11841189
```
11851190
BACKUP INSTANCE 'node'
1186-
============================================================================================================================================
1187-
Instance Version ID Recovery time Mode WAL Current/Parent TLI Time Data Start LSN Stop LSN Status
1188-
============================================================================================================================================
1189-
node 10 P7XDHR 2019-04-10 05:27:15+03 FULL STREAM 1 / 0 11s 200MB 0/18000059 0/18000197 OK
1190-
node 10 P7XDQV 2019-04-08 05:32:59+03 DELTA STREAM 1 / 0 11s 19MB 0/15000060 0/15000198 OK
1191-
node 10 P7XDJA 2019-04-04 05:28:36+03 FULL STREAM 1 / 0 5s 200MB 0/13000028 0/13000198 OK
1191+
==================================================================================================================================
1192+
Instance Version ID Recovery time Mode WAL TLI Time Data WAL Zratio Start LSN Stop LSN Status
1193+
==================================================================================================================================
1194+
node 10 P7XDHR 2019-04-10 05:27:15+03 FULL STREAM 1/0 11s 200MB 16MB 1.0 0/18000059 0/18000197 OK
1195+
node 10 P7XDQV 2019-04-08 05:32:59+03 PAGE STREAM 1/0 11s 19MB 16MB 1.0 0/15000060 0/15000198 OK
1196+
node 10 P7XDJA 2019-04-03 05:28:36+03 FULL STREAM 1/0 21s 32MB 16MB 1.0 0/13000028 0/13000198 OK
11921197
```
11931198

11941199
>NOTE: The Time field for the merged backup displays the time required for the merge.
11951200
1196-
#### Pinning a Backup
1201+
#### Backup Pinning
11971202

11981203
If you have the necessity to exclude certain backups from established retention policy then it is possible to pin a backup for an arbitrary amount of time. Example:
11991204

12001205
pg_probackup set-backup -B backup_dir --instance instance_name -i backup_id --ttl=30d
12011206

1202-
This command will set `expire-time` of specified backup to 30 days starting from backup `recovery-time` attribute. Basically 'expire-time = recovery-time + ttl'.
1207+
This command will set `expire-time` of the specified backup to 30 days starting from backup `recovery-time` attribute. Basically `expire-time` = `recovery-time` + `ttl`.
12031208

1204-
You can set `expire-time` explicitly using `--expire-time` option. Example:
1209+
Also you can set `expire-time` explicitly using `--expire-time` option. Example:
12051210

12061211
pg_probackup set-backup -B backup_dir --instance instance_name -i backup_id --expire-time='2020-01-01 00:00:00+03'
12071212

@@ -1210,7 +1215,7 @@ Alternatively you can use the `--ttl` and `--expire-time` options with the [back
12101215
pg_probackup backup -B backup_dir --instance instance_name -b FULL --ttl=30d
12111216
pg_probackup backup -B backup_dir --instance instance_name -b FULL --expire-time='2020-01-01 00:00:00+03'
12121217

1213-
You can determine the fact that backup is pinned and check due expire time by looking up 'expire-time' attribute in backup metadata via [show](#show) command:
1218+
You can determine the fact that backup is pinned and check due expire time by looking up `expire-time` attribute in backup metadata via [show](#show) command:
12141219

12151220
pg_probackup show --instance instance_name -i backup_id
12161221

@@ -1223,15 +1228,17 @@ data-bytes = 22288792
12231228
...
12241229
```
12251230

1226-
You can unpin a backup by setting `--ttl` option to zero using [set-backup](#set-backup) command. Example:
1231+
You can unpin the backup by setting the `--ttl` option to zero using [set-backup](#set-backup) command. Example:
12271232

12281233
pg_probackup set-backup -B backup_dir --instance instance_name -i backup_id --ttl=0
12291234

1230-
Only pinned backups have `expire-time` attribute in backup metadata.
1235+
Only pinned backups have the `expire-time` attribute in the backup metadata.
1236+
1237+
>NOTE: Pinned incremental backup will also implicitly pin all its parent backups.
12311238
1232-
### WAL Retention Policy
1239+
#### WAL Archive Retention Policy
12331240

1234-
By default, pg_probackup treatment of WAL is very conservative and only "redundant" WAL segments can be purged, i.e. segments that cannot be applied to any existing backup in the backup catalog. To save disk space, you can configure WAL retention policy, to keep WAL of limited depth measured in backups.
1241+
By default, pg_probackup treatment of WAL Archive is very conservative and only "redundant" WAL segments can be purged, i.e. segments that cannot be applied to any of the existing backups in the backup catalog. To save disk space, you can configure WAL Archive retention policy, that allows to keep WAL of limited depth measured in backups per timeline.
12351242

12361243
Suppose you have backed up the *node* instance in the *backup_dir* directory with configured [WAL archiving](#setting-up-continuous-wal-archiving):
12371244

@@ -1578,7 +1585,7 @@ For details, see the section [Merging Backups](#merging-backups).
15781585

15791586
Deletes backup with specified *backip_id* or launches the retention purge of backups and archived WAL that do not satisfy the current retention policies.
15801587

1581-
For details, see the sections [Deleting Backups](#deleting-backups), [Retention Options](#retention-options) and [Configuring Backup Retention Policy](#configuring-backup-retention-policy).
1588+
For details, see the sections [Deleting Backups](#deleting-backups), [Retention Options](#retention-options) and [Configuring Retention Policy](#configuring-retention-policy).
15821589

15831590
#### archive-push
15841591

@@ -1678,8 +1685,8 @@ Specifies [the action](https://www.postgresql.org/docs/current/recovery-target-s
16781685
#### Retention Options
16791686

16801687
You can use these options together with [backup](#backup) and [delete](#delete) commands.
1681-
1682-
For details on configuring retention policy, see the sections [Configuring Backup Retention Policy](#configuring-backup-retention-policy).
1688+
f
1689+
For details on configuring retention policy, see the section [Configuring Retention Policy](#configuring-retention-policy).
16831690

16841691
--retention-redundancy=redundancy
16851692
Default: 0
@@ -1709,7 +1716,7 @@ Displays the current status of all the available backups, without deleting or me
17091716

17101717
You can use these options together with [backup](#backup) and [set-delete](#set-backup) commands.
17111718

1712-
For details on backup pinning, see the section [Pinning a Backup](#pinning-a-backup).
1719+
For details on backup pinning, see the section [Backup Pinning](#backup-pinning).
17131720

17141721
--ttl=ttl
17151722
Specifies the amount of time the backup should be pinned. Must be a positive integer. The zero value unpin already pinned backup. Supported units: ms, s, min, h, d (s by default). Example: `--ttl=30d`.

0 commit comments

Comments
 (0)