[Linux-HA] BUG: Lifetime rule?
Andrew Beekhof
beekhof at gmail.com
Mon Feb 26 02:11:39 MST 2007
On 2/25/07, Max Hofer <max.hofer at apus.co.at> wrote:
> 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?
constraint lifetimes can/should only contain time-related conditions
>
> 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)
even though I don't see the point of having those two lines, it should
still be setting a value. can you file a bug for this please?
> 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
>
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
>
>
More information about the Linux-HA
mailing list