Skip to content

Commit

Permalink
upgrade: Add pgbackrest_stanza_upgrade variable
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks committed Dec 27, 2023
1 parent 8820e7a commit 4f63166
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
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.

...

0 comments on commit 4f63166

Please sign in to comment.