Updating Pgbouncer pg_auth doesn't trigger a reload
Summary
One important step to make PgBouncer aware of Patroni leader changes is to configure Consul integration.
In https://docs.gitlab.com/ee/administration/postgresql/replication_and_failover.html#configuring-the-pgbouncer-node we ask the user to configure an additional pgbouncer['users']
and then run gitlab-ctl reconfigure
.
This should be enough, but it seems we are not reloading pgbouncer
when pg_auth
changes.
Steps to reproduce
- Add a new
pgbouncer['users']
- `gitlab-ctl reconfigure
- try to connect to pgbouncer using that credential
What is the current bug behavior?
PgBouncer doesn't reload automatically
What is the expected correct behavior?
It should reload automatically when pg_auth
changes
Relevant logs
Relevant logs
[2021-05-14T15:14:17+00:00] INFO: Started Chef Infra Zero at chefzero://localhost:1 with repository at /opt/gitlab/embedded One version per cookbook [2021-05-14T15:14:17+00:00] INFO: *** Chef Infra Client 15.14.0 *** [2021-05-14T15:14:17+00:00] INFO: Platform: x86_64-linux [2021-05-14T15:14:17+00:00] INFO: Chef-client pid: 28466 [2021-05-14T15:14:18+00:00] INFO: Setting the run_list to ["recipe[gitlab-ee]"] from CLI options [2021-05-14T15:14:18+00:00] INFO: Run List is [recipe[gitlab-ee]] [2021-05-14T15:14:18+00:00] INFO: Run List expands to [gitlab-ee] [2021-05-14T15:14:18+00:00] INFO: Starting Chef Infra Client Run for gabriel-patroni-primary-geo-pgbouncer.c.group-geo-f9c951.internal [2021-05-14T15:14:18+00:00] INFO: Running start handlers [2021-05-14T15:14:18+00:00] INFO: Start handlers complete. [2021-05-14T15:14:19+00:00] INFO: Loading cookbooks [gitlab-ee@0.0.1, package@0.1.0, gitlab@0.0.1, consul@0.1.0, repmgr@0.1.0, patroni@0.1.0, pgbouncer@0.1.0, runit@5.1.3, logrotate@0.1.0, postgresql@0.1.0, redis@0.1.0, monitoring@0.1.0, registry@0.1.0, mattermost@0.1.0, gitaly@0.1.0, praefect@0.1.0, gitlab-kas@0.1.0, gitlab-pages@0.1.0, letsencrypt@0.1.0, nginx@0.1.0, acme@4.1.1, crond@0.1.0] [2021-05-14T15:14:22+00:00] WARN: Selected systemd because systemctl shows .mount units [2021-05-14T15:14:24+00:00] WARN: only_if block for templatesymlink[Create a gitlab_pages_secret and create a symlink to Rails root] returned a string, did you mean to run a command? [2021-05-14T15:14:24+00:00] WARN: only_if block for templatesymlink[Create a gitlab_kas_secret and create a symlink to Rails root] returned a string, did you mean to run a command? [2021-05-14T15:14:25+00:00] INFO: ruby_block[Link postgresql bin files to the correct version] called [2021-05-14T15:14:26+00:00] INFO: file[/opt/gitlab/service/consul/log/supervise/status] owner changed to 994 [2021-05-14T15:14:26+00:00] INFO: file[/opt/gitlab/service/consul/log/supervise/status] group changed to 994 [2021-05-14T15:14:26+00:00] INFO: file[/opt/gitlab/service/consul/log/supervise/status] updated atime and mtime to 2021-05-14 15:14:26 +0000 [2021-05-14T15:14:26+00:00] INFO: template[/var/opt/gitlab/pgbouncer/pg_auth] backed up to /opt/gitlab/embedded/cookbooks/cache/backup/var/opt/gitlab/pgbouncer/pg_auth.chef-20210514151426.134589 [2021-05-14T15:14:26+00:00] INFO: template[/var/opt/gitlab/pgbouncer/pg_auth] updated file contents /var/opt/gitlab/pgbouncer/pg_auth [2021-05-14T15:14:26+00:00] INFO: Chef Infra Client Run complete in 7.91885508 seconds [2021-05-14T15:14:26+00:00] INFO: Running report handlers [2021-05-14T15:14:26+00:00] INFO: Report handlers complete [2021-05-14T15:14:26+00:00] WARN: This release of Chef Infra Client became end of life (EOL) on May 1st 2021. Please update to a supported release to receive new features, bug fixes, and security updates.