Skip to content
Snippets Groups Projects
Verified Commit bb624bb3 authored by anarcat's avatar anarcat
Browse files

reflect changes in pgbackrest policies

parent 324e3295
No related branches found
No related tags found
No related merge requests found
Pipeline #232803 passed with warnings
......@@ -2242,8 +2242,8 @@ The new backup system is based on [pgBackRest][]. It works by SSH'ing
between the client and server and running `pgbackrest` commands, which
encapsulates all functionality including backup, and restore.
Backups are retained for 3 weeks (21 days), although the source of
truth for this is not here but in Hiera, in `tor-puppet.git`'s
Backups are retained for (30 days), although the source of truth for
this is not here but in Hiera, in `tor-puppet.git`'s
`hiera/common/postgresql.yaml`, the
`pgbackrest::config:global:repo1-retention-full` value. Expiration is
performed when backups are ran, from the systemd timers. See also the
......@@ -2251,6 +2251,46 @@ performed when backups are ran, from the systemd timers. See also the
[pgBackRest]: https://pgbackrest.org/
pgBackRest considers [3 different backup types](https://pgbackrest.org/command.html#command-backup/category-command/option-type), here are schedules
for those:
| type | frequency | note |
|--------|-----------|--------------------------------------------------------------------------------------------------|
| `full` | 30 days | all database cluster files will be copied and there will be no dependencies on previous backups. |
| `diff` | 7 days | like an incremental backup but always based on the last full backup. |
| `incr` | 24h | incremental from the last successful backup. |
Backups are scheduled using systemd timers exported from each node,
based on a template per backup type, so there's a matrix of
`pgbackrest-backup-{diff,full}@.{service,timer}` files on the
repository server, e.g.
```
root@backup-storage-01:~# ls /etc/systemd/system | grep @\\.
pgbackrest-backup-diff@.service
pgbackrest-backup-diff@.timer
pgbackrest-backup-full@.service
pgbackrest-backup-full@.timer
pgbackrest-backup-incr@.service
pgbackrest-backup-incr@.timer
```
Each server has its own instance of that, a symlink to those, for
example weather-01:
```
root@backup-storage-01:~# ls -l /etc/systemd/system | grep weather-01
lrwxrwxrwx 1 root root 31 Dec 5 02:02 pgbackrest-backup-diff@weather-01.service -> pgbackrest-backup-diff@.service
lrwxrwxrwx 1 root root 49 Dec 4 21:51 pgbackrest-backup-diff@weather-01.timer -> /etc/systemd/system/pgbackrest-backup-diff@.timer
lrwxrwxrwx 1 root root 31 Dec 5 02:02 pgbackrest-backup-full@weather-01.service -> pgbackrest-backup-full@.service
lrwxrwxrwx 1 root root 49 Dec 4 21:51 pgbackrest-backup-full@weather-01.timer -> /etc/systemd/system/pgbackrest-backup-full@.timer
lrwxrwxrwx 1 root root 31 Dec 16 18:32 pgbackrest-backup-incr@weather-01.service -> pgbackrest-backup-incr@.service
lrwxrwxrwx 1 root root 49 Dec 16 18:32 pgbackrest-backup-incr@weather-01.timer -> /etc/systemd/system/pgbackrest-backup-incr@.timer
```
Retention is configured at the "full" level, with the
`repo1-retention-full` setting.
### Puppet setup
PostgreSQL servers are automatically configured to use pgBackRest to
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment