barman
barman copied to clipboard
Streaming replication from primary, while using backup from standby (with replication slot)
Hi,
I'm using barman with a standby server to create the backups from, and I would like to use streaming replication from master
I read in the documentation that it's not supported, but I believe it's possible to to work around the issue, by using the streaming conn info to retrieve the replication slot info.
Currently before the pg_receivewal command is executed, the replication slot is checked, since conninfo and rsync point to the standby, the replication slot is unavailable and the receivewal never start due to the error:
ERROR: ArchiverFailure:replication slot 'barman_streaming_replication' doesn't exist. Please execute 'barman receive-wal --create-slot db'
The check happens here: https://github.com/2ndquadrant-it/barman/blob/a577cb3da8dd178ff6f6dc56bf8cdde3b1296e91/barman/wal_archiver.py#L720 and uses the info from the standby, but should use the info from the streaming conninfo