Fix finding paused databases from pgbouncer show databases command
What does this MR do?
Fix finding paused databases from pgbouncer show databases command. The output of SHOW DATABASES
changed, so us harcoding to the 10th column of that output was broken. This MR changes it to dynamically determining which column has the paused
information, and then using that to check if a DB is paused or not.
Testing
- Deploy a PG HA deployment with package/image from this MR - https://docs.gitlab.com/ee/administration/postgresql/replication_and_failover.html. If wanted, you can use https://gitlab.com/balasankarc/omnibus-gitlab-docker-compose/-/tree/main/postgresql/multi-node-ha for this.
- Shut down Patroni in the Leader node, so that failover happens.
- Look at the Consul logs (
gitlab-ctl tail consul
) - Ensure that the error mentioned in #8166 (closed) is not seen.
- Look at the PGBouncer logs, and confirm that it is getting reloaded by Consul.
Related issues
Closes #8166 (closed)
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion.
Required
-
MR title and description are up to date, accurate, and descriptive. -
MR targeting the appropriate branch. -
Latest Merge Result pipeline is green. -
When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow.
For GitLab team members
If you don't have access to this, the reviewer should trigger these jobs for you during the review process.
-
The manual Trigger:ee-package
jobs have a green pipeline running against latest commit. -
If config/software
orconfig/patches
directories are changed, make sure thebuild-package-on-all-os
job within theTrigger:ee-package
downstream pipeline succeeded. -
If you are changing anything SSL related, then the Trigger:package:fips
manual job within theTrigger:ee-package
downstream pipeline must succeed. -
If CI configuration is changed, the branch must be pushed to dev.gitlab.org
to confirm regular branch builds aren't broken.
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes. -
Documentation created/updated. -
Tests added. -
Integration tests added to GitLab QA. -
Equivalent MR/issue for the GitLab Chart opened. -
Validate potential values for new configuration settings. Formats such as integer 10
, duration10s
, URIscheme://user:passwd@host:port
may require quotation or other special handling when rendered in a template and written to a configuration file.
Edited by Robert Marshall