Reconfigure fails on secondary in HA config due to an alter of the gitlab_repmgr user
In an HA setup using repmgrd https://docs.gitlab.com/ee/administration/high_availability/database.html
The gitlab_repmgr
user already exists:
template1=# \du
...
gitlab_repmgr | Superuser | {}
But when reconfigure
is run on the secondary we see:
Recipe: repmgr::enable
* template[/var/opt/gitlab/postgresql/repmgr.conf] action create (up to date)
* postgresql_user[gitlab_repmgr] action create
* execute[create gitlab_repmgr postgresql user] action run (skipped due to not_if)
* execute[set password for gitlab_repmgr postgresql user] action run
[execute] ERROR: cannot execute ALTER ROLE in a read-only transaction
This is because it doing an alter because the password set for gitlab_repmgr
does not match since we do not specify the md5 hash of the password in the configuration.
This was working before but broke recently due to this recent commit - 2f39c544
See slack conversation for more context.