On Tue, Jul 27, 2021 at 12:20 PM Dan N <
anonyopse...@gmail.com> wrote:
>
> What I did is changed
> max_locks_per_transaction from 64 to 128 and restarted the PostreSQL cluster from patroni.
> And then I got the alert that Barman is not receiving wal.
> I tried everything from starting the wal again aka barman receive-wal pgsql
> and couple other suggestion on found on net and nothing helped.
This doesn't really explain the problem fully. Restarting the server
after changing max_locks_per_transaction should not have caused any
more of a disruption than just having to restart `barman receive-wal`,
which `barman cron` would have done automatically for you anyway.
> As I replied to Abhijit; `barman receive-wal --reset` is giving me "Nothing to do. Position of receive-wal is aligned."
I tried to reproduce your situation while waiting for breakfast to
finish cooking:
barman@unarmed:~$ barman receive-wal --stop uptight
Stopped process receive-wal(6196)
barman@unarmed:~$ barman receive-wal --drop-slot uptight
Dropping physical replication slot 'backup_unarmed' on server 'uptight'
Replication slot 'backup_unarmed' dropped
(Here I went to Postgres and set max_wal_size to a lower value and
executed some checkpoint/pg_switch_wal to advance the WAL position and
recycle old segments.)
barman@unarmed:~$ barman receive-wal --create-slot uptight
Creating physical replication slot 'backup_unarmed' on server 'uptight'
Replication slot 'backup_unarmed' created
barman@unarmed:~$ barman receive-wal uptight
Starting receive-wal for server uptight
uptight: pg_receivewal.orig: starting log streaming at 0/66000000 (timeline 1)
uptight: pg_receivewal.orig: unexpected termination of replication
stream: ERROR: requested WAL segment 000000010000000000000066 has
already been removed
uptight: pg_receivewal.orig: disconnected
ERROR: ArchiverFailure:pg_receivexlog terminated with error code: 1
Right, this is what I expected: I dropped the slot and recycled WAL,
so barman receive-wal can't start at the same place.
barman@unarmed:~$ barman receive-wal --reset uptight
Resetting receive-wal directory status
Creating status file
/var/lib/barman/uptight/streaming/000000010000000000000081.partial
barman@unarmed:~$ barman receive-wal uptight
Starting receive-wal for server uptight
uptight: pg_receivewal.orig: starting log streaming at 0/81000000 (timeline 1)
…and we're back to normal. So there's definitely something more that
must have happened on your server, but I have no idea what.
You could try removing whatever is in your streaming/ directory and
run --reset again and see if that helps restart receive-wal.
-- Abhijit