Repmgr standby setup requires replication slot in 12.0
The following discussion from !3417 (merged) should be addressed:
But when joining my standby db I got the following error:
INFO: executing: '/opt/gitlab/embedded/bin/pg_basebackup -l "repmgr base backup" -D /var/opt/gitlab/postgresql/data -h ec853c8fd33f -p 5432 -U gitlab_repmgr -X stream ' pg_basebackup: could not create temporary replication slot "pg_basebackup_28395": ERROR: all replication slots are in use HINT: Free one or increase max_replication_slots. pg_basebackup: child process exited with error 1 pg_basebackup: removing contents of data directory "/var/opt/gitlab/postgresql/data" WARNING: standby clone: base backup failed ERROR: unable to take a base backup of the master server WARNING: destination directory (/var/opt/gitlab/postgresql/data) may need to be cleaned up manually
And in order to fix it I had to set
postgresql['max_replication_slots'] = 1
on the primary.
^ I'm seeing this both in an upgrade scenario, and for a fresh install of 12.0.3
If this is a new requirement for repmgr we should add it to the docs: https://docs.gitlab.com/ee/administration/high_availability/database.html#configuring-the-database-nodes