[Pacemaker] promote determent of mysql RA
Junko IKEDA
tsukishima.ha at gmail.com
Wed Nov 2 05:36:36 UTC 2011
Hi,
I'm trying to set up MySQL Replication enviroment .
glance around mysql RA, it uses "crm_master" to deter the promotion of
the out-of-sync slave node.
https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/mysql#L496
elif ocf_is_ms; then
# Even if we're not set to evict lagging slaves, we can
# still use the seconds behind master value to set our
# master preference.
local master_pref
master_pref=$((${OCF_RESKEY_max_slave_lag}-${secs_behind}))
if [ $master_pref -lt 0 ]; then
# Sanitize a below-zero preference to just zero
master_pref=0
fi
$CRM_MASTER -v $master_pref
fi
mysql RA sets "0" as the attribute score using crm_master.
but, if there is only one node (this node might be out-of-sync),
it seems that Pacemaker ignore its socre and this node will be
promoted even as it is out-of-sync.
I think mysql RA should be set "-INFINITY" in this case. Is it correct?
I found the following comment in drbd RA,
but this issue regarding negative master scores has already been
resolved in the latest Pacemaker.
http://git.drbd.org/?p=drbd-8.3.git;a=blob;f=scripts/drbd.ocf;h=06ffed1dc5cbf6db4c2809d33b4f40da2215d628;hb=HEAD#l410
410 *)
411 # Our local disk is not up to date.
412 # Our peer is not available.
413 # We have no access to useful data.
414 # DRBD would refuse to be promoted, anyways.
415 #
416 # set_master_score -INFINITY
417 # Too bad, at least with current (Oktober 2009) Pacemaker,
418 # negative master scores cause instance stop;
restart cycle :(
419 # Hope that this will suffice.
420 remove_master_score
Regards,
Junko IKEDA
NTT DATA INTELLILINK CORPORATION
More information about the Pacemaker
mailing list