Merge "Fix race condition for primary component bootstrap"

This commit is contained in:
Jenkins 2017-05-03 12:51:12 +00:00 committed by Gerrit Code Review
commit 3452880880
1 changed files with 6 additions and 7 deletions

View File

@ -503,6 +503,7 @@ check_if_galera_pc() {
fi fi
if [ ${pcnum} -gt 1 ]; then if [ ${pcnum} -gt 1 ]; then
ocf_log err "${LH} But I'm running a new cluster, PID:${pid}, this is a split-brain!" ocf_log err "${LH} But I'm running a new cluster, PID:${pid}, this is a split-brain!"
clear_node_pc
exit $OCF_ERR_GENERIC exit $OCF_ERR_GENERIC
fi fi
done done
@ -676,8 +677,6 @@ mysql_start() {
local rc local rc
local dir local dir
local mysql_extra_params local mysql_extra_params
local set_pc=0
if mysql_status info 1; then if mysql_status info 1; then
ocf_log info "${LH} MySQL already running" ocf_log info "${LH} MySQL already running"
@ -729,12 +728,13 @@ mysql_start() {
rc=$? rc=$?
if [ $rc -eq 0 ]; then if [ $rc -eq 0 ]; then
mysql_extra_params="$mysql_extra_params --wsrep-new-cluster" mysql_extra_params="$mysql_extra_params --wsrep-new-cluster"
set_pc=1 update_node_pc
else
clear_node_pc
fi fi
fi fi
clear_node_pc
ocf_log info "${LH} Starting MySQL" ocf_log info "${LH} Starting MySQL"
${OCF_RESKEY_binary} \ ${OCF_RESKEY_binary} \
--pid-file=$OCF_RESKEY_pid \ --pid-file=$OCF_RESKEY_pid \
@ -746,6 +746,7 @@ mysql_start() {
if [ $rc -ne 0 ]; then if [ $rc -ne 0 ]; then
ocf_log err "${LH} MySQL start command failed: $rc" ocf_log err "${LH} MySQL start command failed: $rc"
clear_node_pc
return $rc return $rc
fi fi
@ -763,8 +764,6 @@ mysql_start() {
done done
ocf_log info "${LH} MySQL started" ocf_log info "${LH} MySQL started"
[ ${set_pc} -eq 1 ] && update_node_pc
[ $rc -ne $OCF_SUCCESS ] && update_node_gtid
return $OCF_SUCCESS return $OCF_SUCCESS
} }