Browse Source

check for sst_in_progress

PROD-16528

Change-Id: Iacc949fb68e323632e0ed7a60e11c44a9812e724
master
Jiri Broulik 6 years ago
parent
commit
31b91b05b1
3 changed files with 11 additions and 0 deletions
  1. +9
    -0
      galera/files/bootstrap.sh
  2. +1
    -0
      galera/master.sls
  3. +1
    -0
      galera/slave.sls

+ 9
- 0
galera/files/bootstrap.sh View File



counter=${1:-60} counter=${1:-60}
retries=0 retries=0
sst_in_progress='/var/lib/mysql/sst_in_progress'


while [ $counter -gt 0 ] while [ $counter -gt 0 ]
do do
fi fi
counter=$(( counter - 1 )) counter=$(( counter - 1 ))
retries=$(( retries + 1 )) retries=$(( retries + 1 ))
{%- if slave %}
if [ $retries -gt 20 ]; then
if [ ! -e $sst_in_progress ]; then
echo "No sst is in progress."
break
fi
fi
{%- endif %}
sleep ${2:-10} sleep ${2:-10}
done done



+ 1
- 0
galera/master.sls View File

- source: salt://galera/files/bootstrap.sh - source: salt://galera/files/bootstrap.sh
- defaults: - defaults:
service: {{ master|yaml }} service: {{ master|yaml }}
slave: False
- 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' %}

+ 1
- 0
galera/slave.sls View File

- mode: 755 - mode: 755
- defaults: - defaults:
service: {{ slave|yaml }} service: {{ slave|yaml }}
slave: True
- source: salt://galera/files/bootstrap.sh - source: salt://galera/files/bootstrap.sh
- template: jinja - template: jinja



Loading…
Cancel
Save