Skip to content

Commit

Permalink
Add pgbouncer_pool_pause_timeout variable
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks committed Mar 19, 2024
1 parent 7e76300 commit 9b5b4ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion roles/upgrade/tasks/pgbouncer_pause.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
pgb_servers="$pg_servers"
pgb_servers_count="$pg_servers_count"
pgb_count="{{ (groups['primary'] | default([]) | length + groups['secondary'] | default([]) | length) * (pgbouncer_processes | default(1) | int) }}"
pgb_pause_command="printf '%s\n' {{ pgb_unix_socket_dirs }} | xargs -I {} -P {{ pgbouncer_processes | default(1) | int }} -n 1 timeout 2 psql -h {} -p {{ pgbouncer_listen_port }} -U {{ patroni_superuser_username }} -d pgbouncer -tAXc 'PAUSE'"
pgb_pause_command="printf '%s\n' {{ pgb_unix_socket_dirs }} | xargs -I {} -P {{ pgbouncer_processes | default(1) | int }} -n 1 timeout {{ pgbouncer_pool_pause_timeout }} psql -h {} -p {{ pgbouncer_listen_port }} -U {{ patroni_superuser_username }} -d pgbouncer -tAXc 'PAUSE'"
pgb_resume_command='kill -SIGUSR2 $(pidof pgbouncer)'
start_time=$(date +%s)
Expand Down
2 changes: 2 additions & 0 deletions vars/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ copy_files_to_all_server: []

# if 'pgbouncer_install' is 'true'
pgbouncer_pool_pause: true # or 'false' if you don't want to pause pgbouncer pools during upgrade.
# the maximum waiting time (in seconds) for the pool to be paused. For each iteration of the loop when trying to pause all pools.
pgbouncer_pool_pause_timeout: 2
# the time (in seconds) after which instead of waiting for the completion of the active queries, the script terminates the slow active queries.
pgbouncer_pool_pause_terminate_after: 30
# the time (in seconds) after which the script exit with an error if it was not possible to pause all pgbouncer pools.
Expand Down

0 comments on commit 9b5b4ee

Please sign in to comment.