[Linux-HA] BUG: Lifetime rule?
Max Hofer
max.hofer at apus.co.at
Sun Feb 25 06:27:59 MST 2007
I played around with the lifetime attribute in constraints and i found
following behaviour strange (or maybe i don't understand the meaning
of the lifetime attribute).
Attached a cib which implements the same expression twice, once
in a rule of a lifetime attribute and once in a normal rule.
The expression just checks the value of a variable in the status section
(which i added manually with attrd_updater).
The same expression fails in 'dummy-restart-hysteresis-lifetime-rule' but
evaluates correctly in 'dummy-location-rule2'. (evaluated with ptest)
I think this is not correct - or am I wrong?
Attached the CIB and ptest output.
General question: the reason to use the lifetime rule comes from by
desired functionality to not restart a failed resource for a certain amount
of time.
My implementation is the following:
* the stop operation of the resource agent maps an attribute in the CIB
with a dampen delete operation, something like
restart_hysteresis() {
local hysteresis=${1:="30s"} # set default restart hysteresis to 30 seconds
attrd_updater -d 0 -n resource-stopped -v true
sleep 0.5 # this is needed or no attribute is set (!!! a bug IMHO)
attrd_updater -d "$hysteresis" -n resource-stopped -v true
}
* now make a rule with a lifetime which disables the resource. The lifetime
should evaluate to 'true' as long 'resource-stopped' is 'true'.
(i know i could implement this also without lifetime ... i just was curious
if this would work)
Does anyone know an easier way to achieve the described hysteresis behaviour?
kind regards Max
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cib-lifetime.xml.bz2
Type: application/x-bzip2
Size: 1542 bytes
Desc: not available
Url : http://lists.community.tummy.com/pipermail/linux-ha/attachments/20070225/8f519163/cib-lifetime.xml.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ptest-lifetime.txt.bz2
Type: application/x-bzip2
Size: 5337 bytes
Desc: not available
Url : http://lists.community.tummy.com/pipermail/linux-ha/attachments/20070225/8f519163/ptest-lifetime.txt.bin
More information about the Linux-HA
mailing list