Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade: Add pgbackrest_stanza_upgrade variable #541

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions roles/upgrade/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ If these checks pass, the playbook switches back to the old PostgreSQL paths and
| `pgbouncer_pool_pause_stop_after` | Time in seconds after which the script exits with an error if unable to pause all pgbouncer pools. | `60` |
| `pg_slow_active_query_treshold` | Time in milliseconds to wait for active queries before trying to pause the pool. | `1000` |
| `pg_slow_active_query_treshold_to_terminate` | Time in milliseconds after reaching "pgbouncer_pool_pause_terminate_after" before the script terminates active queries. | `100` |
| `pgbackrest_stanza_upgrade` | Perform the "stanza-upgrade" command after the upgrade (if 'pgbackrest_install' is 'true'). | `true` |

Note: For variables marked as "Derived value", the default value is determined based on other variables. \
Please see the variable file vars/[upgrade.yml](../../vars/upgrade.yml)
Expand Down
4 changes: 2 additions & 2 deletions roles/upgrade/tasks/post_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@

- name: pgbackrest | Upgrade stanza "{{ pgbackrest_stanza }}"
ansible.builtin.command: "pgbackrest --stanza={{ pgbackrest_stanza }} --no-online stanza-upgrade"
when: pg_path_count.stdout | length > 0
when: pg_path_count.stdout | length > 0 and pgbackrest_stanza_upgrade | bool
become: true
become_user: postgres
ignore_errors: true
Expand Down Expand Up @@ -125,7 +125,7 @@
delegate_to: "{{ groups['pgbackrest'][0] }}"
run_once: true
ansible.builtin.command: "pgbackrest --stanza={{ pgbackrest_stanza }} --no-online stanza-upgrade"
when: pg_path_count.stdout | length > 0
when: pg_path_count.stdout | length > 0 and pgbackrest_stanza_upgrade | bool
become: true
become_user: "{{ pgbackrest_repo_user }}"
ignore_errors: true
Expand Down
3 changes: 3 additions & 0 deletions vars/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,7 @@ pg_slow_active_query_treshold: 1000
# terminate active queries that longer than the specified time (in milliseconds) after reaching "pgbouncer_pool_pause_terminate_after" before trying to pause the pool.
pg_slow_active_query_treshold_to_terminate: 100 # (0 = terminate all active backends)

# if 'pgbackrest_install' is 'true'
pgbackrest_stanza_upgrade: true # perform the "stanza-upgrade" command after the upgrade.

...