Hi,
I have configured Barman 2.10-5 to back up our Postgres 11 servers. Postgres is configured with streaming replication to a standby server. The primary Postgres server backs up to barman server 1 (in datacentre 1) and the standby Postgres server backs up to barman server 2 (in datacentre 2).
Both streaming backup and archive_command (using barman-wal-archive command) are enabled - this appears to be a valid configuration in the Barman manual. I previously used rsync instead of barman-wal-archive to see if it helped solve this issue.
When I run barman check on barman server 2 (which receives from the standby Postgres server only) , I see there are a number of duplicates and the errors folder contains the duplicate files. Barman check on barman server 1 has no errors.
If I search for the id of an example duplicate wal segment on the filesystem of barman server 2, I can find the file present in both the wals folder and the errors folder. Both files have the same date/time stamp, are the same size and have the same checksum.
On checking the barman.log file, I see the following (where X is the duplicate id)
Received file 'X' with checksum '...' by put-wal for server 'postgres_fqdn' (SSH Host: 'IP address of postgres_fqdn')
Archiving 1 of 1 from streaming: postgres_fqdn/X
Archiving segment 1 of 1 from file archival postgres_fqdn/X
Error X is already present in server postgres_fqdn . File moved to errors directory
Those are the only log entries related to this specific ID. The logs suggest that the file was received from the correct postgres server and I don't see any evidence that both the primary and standby server are configured to send to the same barman server.
So I'm wondering, is this just a side effect of having both streaming backup and using the archive_command at the same time? If that's the case, should I make any configuration changes to avoid this situation?
I hope this description is clear. Very happy to provide additional details if required.
Thanks
Ian
I found the following in the documentation so this is expected behaviour:
http://docs.pgbarman.org/release/2.12/
NOTE: Unfortunately, it is not currently possible to enable both WAL archiving and streaming from the standby due to the way Barman performs WAL duplication checks and an undocumented behaviours in all versions of PostgreSQL.