Skip to content
Snippets Groups Projects
Commit 25c2155d authored by DJ Mountney's avatar DJ Mountney
Browse files

Merge branch '2711-create-tool-for-interacting-with-pgbouncer' into 'master'

Resolve "Create tool for interacting with pgbouncer"

Closes #2711

See merge request !1920
parents fa938776 80e460c1
No related branches found
No related tags found
1 merge request!1920Resolve "Create tool for interacting with pgbouncer"
Loading
Loading
@@ -18,6 +18,7 @@ omnibus-gitlab repository.
- Remove geo_bulk_notify_worker_cron 44def4b5
- Rework `single_quote` helper as `quote` that can handle escaping
strings with embedded quotes fdc6a93
- Add gitlab-ctl pgb-console command
- Add omniauth sync_profile_from_provider and sync_profile_attributes configuration
- Only generate a private SSH key on Geo secondaries c2f2dcba
- Support LFS object storage options for GitLab EEP
Loading
Loading
@@ -25,7 +26,7 @@ omnibus-gitlab repository.
9.5.5
 
- Add more options to repmgr.conf template
- Update pgbouncer to use one style of logging
- Update pgbouncer to use one style of logging
- Set bootstrap_expect to default to 3 for consul servers
- Fix bug where pgb-notify would fail when databases.json was empty
 
Loading
Loading
Loading
Loading
@@ -79,13 +79,17 @@ module Pgbouncer
end
end
 
def pgbouncer_command(command)
def build_command_line
psql = "#{install_path}/embedded/bin/psql"
host = options['host'] || attributes['gitlab']['pgbouncer']['listen_addr']
host = '127.0.0.1' if host.eql?('0.0.0.0')
port = options['port'] || attributes['gitlab']['pgbouncer']['listen_port']
"#{psql} -d pgbouncer -h #{host} -p #{port} -U #{options['user']}"
end
def pgbouncer_command(command)
GitlabCtl::Util.get_command_output(
"#{psql} -d pgbouncer -h #{host} -p #{port} -c '#{command}' -U #{options['user']}",
"#{build_command_line} -c '#{command}'",
options['host_user']
)
rescue GitlabCtl::Errors::ExecutionError => results
Loading
Loading
@@ -116,5 +120,9 @@ module Pgbouncer
write
reload
end
def console
exec(build_command_line)
end
end
end
Loading
Loading
@@ -17,6 +17,11 @@
require "#{base_path}/embedded/service/omnibus-ctl-ee/lib/pgbouncer"
require "#{base_path}/embedded/service/omnibus-ctl/lib/postgresql"
 
add_command_under_category('pgb-console', 'pgbouncer', 'Connect to the pgbouncer console', 2) do
pgb = get_client
pgb.console
end
add_command_under_category('pgb-notify', 'pgbouncer', 'Notify pgbouncer of an update to its database', 2) do
pgb = get_client
pgb.notify
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment