Suite de ma note 2025-02-12_1511.
J'ai passé 5h40 sur un POC de barman, mais je n'ai pas eu beaucoup plus de succès qu'avec pgBackRest. Décidément, ces outils ne m'aiment pas 😔.
Repository du POC : https://github.com/stephane-klein/poc-barman
La commande barman check streaming-server
retourne le message WAL archive: FAILED (please make sure WAL shipping is setup)
. Pour fixer cette erreur, je dois faire les manipulations suivantes que je trouve bizarre :
$ ./scripts/enter-in-pg1.sh
postgres=# select pg_switch_wal();
pg_switch_wal
---------------
0/206A330
(1 row)
et ensuite :
$ docker compose exec barman bash
root@5482aa5f8420:/# su barman
barman@5482aa5f8420:/$ barman cron
Starting WAL archiving for server streaming-server
barman@5482aa5f8420:/$ barman check streaming-server
Server streaming-server:
PostgreSQL: OK
superuser or standard user with backup privileges: OK
PostgreSQL streaming: OK
wal_level: OK
replication slot: OK
directories: OK
retention policy settings: OK
backup maximum age: OK (no last_backup_maximum_age provided)
backup minimum size: OK (0 B)
wal maximum age: OK (no last_wal_maximum_age provided)
wal size: OK (0 B)
compression settings: OK
failed backups: OK (there are 0 failed backups)
minimum redundancy requirements: OK (have 0 backups, expected at least 0)
pg_basebackup: OK
pg_basebackup compatible: OK
pg_basebackup supports tablespaces mapping: OK
systemid coherence: OK (no system Id stored on disk)
pg_receivexlog: OK
pg_receivexlog compatible: OK
receive-wal running: OK
archiver errors: OK
Je ne sais pas pourquoi je dois lancer select pg_switch_wal();
.
J'ai pourtant configuré checkpoint_timeout='60s'
:
command: >
postgres
-c wal_level=replica
-c summarize_wal=on
-c checkpoint_timeout='60s'
-c max_wal_size='100MB'
Je pensais que ce paramètre effectuait la même action que pg_switch_wal();
mais je constate que non.
Aussi, je constate que je dois aussi lancer pg_switch_wal();
pour que la commande suivante se termine :
barman@5482aa5f8420:/$ barman backup streaming-server --wait
Starting backup using postgres method for server streaming-server in /var/lib/barman/streaming-server/base/20250212T221703
Backup start at LSN: 0/5000B40 (000000010000000000000005, 00000B40)
Starting backup copy via pg_basebackup for 20250212T221703
Copy done (time: 1 second)
Finalising the backup.
Backup size: 22.3 MiB
Backup end at LSN: 0/7000000 (000000010000000000000007, 00000000)
Backup completed (start time: 2025-02-12 22:17:03.190492, elapsed time: 1 second)
Waiting for the WAL file 000000010000000000000007 from server 'streaming-server'
Processing xlog segments from streaming for streaming-server
000000010000000000000005
Processing xlog segments from streaming for streaming-server
000000010000000000000006
Je ne comprends pas non plus pourquoi.