[Linux-HA] BUG: Lifetime rule?

Max Hofer max.hofer at apus.co.at
Mon Feb 26 05:14:58 MST 2007


On Monday 26 February 2007 10:11, Andrew Beekhof wrote:
> 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
The point is I need a hysteresis variable which is set to a specific value
(in my case true) and which is AUTOMATICALLY cleaned after 
a certain time (i remove the attribute from the CIB - i could just set 
to to false - which would work too)

How else could i prevent the restart of a failed resource for a defined
time period? I found no other way.

> still be setting a value.  can you file a bug for this please?
done bug #1500 

> 
> >   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
> >
> >
> _______________________________________________
> 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
> 

-- 
Max Hofer
APUS Software G.m.b.H.
A-8074 Raaba, Bahnhofstraße 1/1
T| +43 316 401629 11
F| +43 316 401629 9
W| www.apus.co.at
E| max.hofer at apus.co.at


More information about the Linux-HA mailing list