Fix handlers
The handler to restart mysql is using an incorrect registered variable
to check if the restart succeeded, leading to multiple service restarts
each time its notified.
The 'Remove stale .sst' and 'Restart mysql fall back' handlers will only
be notified if 'Restart mysql' is 'changed', but their when clauses
were checking for 'failed'. Regardless, their when clauses can be
removed.
Change-Id: Icc038d17b560b24bb9bf5fdd523835102ca97030
(cherry picked from commit a94f88dddc
)
This commit is contained in:
parent
e5a8c064c4
commit
00afe1c07f
|
@ -24,21 +24,20 @@
|
|||
MYSQLD_STARTUP_TIMEOUT: 180
|
||||
when: not galera_running_and_bootstrapped | bool
|
||||
register: galera_restart
|
||||
until: galera_restart_fall_back | success
|
||||
until: galera_restart | success
|
||||
retries: 3
|
||||
delay: 5
|
||||
# notifies are only fired when status is "changed"
|
||||
changed_when: galera_restart | failed
|
||||
failed_when: false
|
||||
notify:
|
||||
- "remove stale .sst"
|
||||
- "Remove stale .sst"
|
||||
- "Restart mysql fall back"
|
||||
|
||||
- name: remove stale .sst
|
||||
- name: Remove stale .sst
|
||||
file:
|
||||
path: "/var/lib/mysql/.sst"
|
||||
state: absent
|
||||
when: galera_restart | failed
|
||||
|
||||
- name: Restart mysql fall back
|
||||
service:
|
||||
|
@ -49,7 +48,6 @@
|
|||
args: "{{ (not galera_existing_cluster | bool and inventory_hostname == galera_server_bootstrap_node) or (galera_cluster_members | length == 1) | ternary('--wsrep-new-cluster', '') }}"
|
||||
environment:
|
||||
MYSQLD_STARTUP_TIMEOUT: 180
|
||||
when: galera_restart | failed
|
||||
register: galera_restart_fall_back
|
||||
until: galera_restart_fall_back | success
|
||||
retries: 3
|
||||
|
|
Loading…
Reference in New Issue