You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+113-3Lines changed: 113 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,8 @@
1
-
pg_arman
2
-
========
1
+
pg_arman fork from Postgres Professional
2
+
========================================
3
+
4
+
This repository contains fork of pg_arman by Postgres Professional with
5
+
block level incremental backup support.
3
6
4
7
pg_arman is a backup and recovery manager for PostgreSQL servers able to do
5
8
differential and full backup as well as restore a cluster to a
@@ -14,7 +17,8 @@ Download
14
17
--------
15
18
16
19
The latest version of this software can be found on the project website at
17
-
https://github.com/michaelpq/pg_arman.
20
+
https://github.com/postgrespro/pg_arman. Original fork of pg_arman can be
21
+
found athttps://github.com/michaelpq/pg_arman.
18
22
19
23
Installation
20
24
------------
@@ -48,6 +52,112 @@ launched in a way similar to common PostgreSQL extensions and modules:
48
52
49
53
make installcheck
50
54
55
+
Block level incremental backup
56
+
------------------------------
57
+
58
+
Idea of block level incremental backup is that you may backup only blocks
59
+
changed since last full backup. It gives two major benefits: taking backups
60
+
faster and making backups smaller.
61
+
62
+
The major question here is how to get the list of changed blocks. Since
63
+
each block contains LSN number, changed blocks could be retrieved by full scan
64
+
of all the blocks. But this approach consumes as much server IO as full
65
+
backup.
66
+
67
+
This is why we implemented alternative approaches to retrieve
68
+
list of changed blocks.
69
+
70
+
1. Scan WAL archive and extract changed blocks from it. However, shortcoming
71
+
of these approach is requirement to have WAL archive.
72
+
73
+
2. Track bitmap of changes blocks inside PostgreSQL (ptrack). It introduces
74
+
some overhead to PostgreSQL performance. On our experiments it appears to be
75
+
less than 3%.
76
+
77
+
These two approaches were implemented in this fork of pg_arman. The second
78
+
approach requires[patch for PostgreSQL](https://gist.github.com/stalkerg/7ce2394c4f3b36f995895190a633b4fa).
79
+
80
+
Testing block level incremental backup
81
+
--------------------------------------
82
+
83
+
You need build and install[PGPRO9_5_ptrack branch of PostgreSQL](https://github.com/postgrespro/postgrespro/tree/PGPRO9_5_ptrack) or[apply this patch to PostgreSQL 9.5](https://gist.github.com/stalkerg/7ce2394c4f3b36f995895190a633b4fa).
84
+
85
+
###Retrieving changed blocks from WAL archive
86
+
87
+
You need to enable WAL archive by adding following lines to postgresql.conf:
The advantage of this approach is that you don't have to save WAL archive. You will need to enable ptrack in postgresql.conf (restart required).
126
+
127
+
```
128
+
ptrack_enable = on
129
+
```
130
+
131
+
Also, some WALs still need to be fetched in order to get consistent backup. pg_arman can fetch them trough the streaming replication protocol. Thus, you also need to[enable streaming replication connection](https://wiki.postgresql.org/wiki/Streaming_Replication).