Issue: During bootstrap, formula creates file in: /var/lib/mysql If galera replica has been broken for any reason, wsrep process calls xtrabackup to recover replica and wipes away everything in /var/lib/mysql with bootstrap flag as well. Now this node is not marked as deployed and galera state rerun would try to reprovision it and fail. Fix: Create and check flag in: /etc/mysql/.galera_bootstrap Prod-Related: PROD-22715 Closes-Bug: PROD-22715 Change-Id: I27db65e1161e22a462dfd273647de4edbe450373master
@@ -134,6 +134,7 @@ galera_bootstrap_script: | |||
- template: jinja | |||
{%- if salt['cmd.shell']('test -e /var/lib/mysql/.galera_bootstrap; echo $?') != '0' %} | |||
{%- if salt['cmd.shell']('test -e /etc/salt/.galera_bootstrap; echo $?') != '0' %} | |||
# Enforce config before package installation | |||
galera_pre_config: | |||
@@ -206,7 +207,7 @@ galera_bootstrap_start_service_final: | |||
galera_bootstrap_finish_flag: | |||
file.touch: | |||
- name: /var/lib/mysql/.galera_bootstrap | |||
- name: /etc/salt/.galera_bootstrap | |||
- require: | |||
- cmd: galera_bootstrap_start_service_final | |||
- watch_in: | |||
@@ -233,3 +234,4 @@ galera_service: | |||
{%- endif %} | |||
{%- endif %} | |||
{%- endif %} |
@@ -132,6 +132,7 @@ galera_bootstrap_script: | |||
- template: jinja | |||
{%- if salt['cmd.shell']('test -e /var/lib/mysql/.galera_bootstrap; echo $?') != '0' %} | |||
{%- if salt['cmd.shell']('test -e /etc/salt/.galera_bootstrap; echo $?') != '0' %} | |||
# Enforce config before package installation | |||
galera_pre_config: | |||
@@ -205,7 +206,7 @@ galera_bootstrap_start_service_final: | |||
galera_bootstrap_finish_flag: | |||
file.touch: | |||
- name: /var/lib/mysql/.galera_bootstrap | |||
- name: /etc/salt/.galera_bootstrap | |||
- require: | |||
- cmd: galera_bootstrap_start_service_final | |||
- watch_in: | |||
@@ -232,4 +233,5 @@ galera_service: | |||
{%- endif %} | |||
{%- endif %} | |||
{%- endif %} | |||