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
- template: jinja | - template: jinja | ||||
{%- if salt['cmd.shell']('test -e /var/lib/mysql/.galera_bootstrap; echo $?') != '0' %} | {%- 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 | # Enforce config before package installation | ||||
galera_pre_config: | galera_pre_config: | ||||
galera_bootstrap_finish_flag: | galera_bootstrap_finish_flag: | ||||
file.touch: | file.touch: | ||||
- name: /var/lib/mysql/.galera_bootstrap | |||||
- name: /etc/salt/.galera_bootstrap | |||||
- require: | - require: | ||||
- cmd: galera_bootstrap_start_service_final | - cmd: galera_bootstrap_start_service_final | ||||
- watch_in: | - watch_in: | ||||
{%- endif %} | {%- endif %} | ||||
{%- endif %} | {%- endif %} | ||||
{%- endif %} |
- template: jinja | - template: jinja | ||||
{%- if salt['cmd.shell']('test -e /var/lib/mysql/.galera_bootstrap; echo $?') != '0' %} | {%- 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 | # Enforce config before package installation | ||||
galera_pre_config: | galera_pre_config: | ||||
galera_bootstrap_finish_flag: | galera_bootstrap_finish_flag: | ||||
file.touch: | file.touch: | ||||
- name: /var/lib/mysql/.galera_bootstrap | |||||
- name: /etc/salt/.galera_bootstrap | |||||
- require: | - require: | ||||
- cmd: galera_bootstrap_start_service_final | - cmd: galera_bootstrap_start_service_final | ||||
- watch_in: | - watch_in: | ||||
{%- endif %} | {%- endif %} | ||||
{%- endif %} | {%- endif %} | ||||
{%- endif %} | |||||