[ClusterLabs] Trying to understand dampening (ping)

Ken Gaillot kgaillot at redhat.com
Thu Oct 14 18:44:13 EDT 2021


On Thu, 2021-10-14 at 20:51 +0000, martin doc wrote:
> 
> 
> From: Andrei Borzenkov <arvidjaar at gmail.com>,  Friday, 15 October
> 2021 4:59 AM
> ...
> > Dampening defines delay before attributes are committed to CIB.
> > Private attributes are never ever written into CIB, so dampening
> > makes no sense here. Private attributes are managed by attrd
> > itself and you see the latest value.
> 
> > If you change transient attribute (without -p option) value you
> > will see different values reported by
> 
> > attrd_updater -n my_ping -Q
> 
> > and
> 
> > cibadmin -Q -A "//nvpair[@name='my_ping']"
> 
> > until dampening timeout expires.
> 
> > This applies even to deleting attribute.
> 
> Ok, now I understand what the dampen function does.
> 
> If I understand this correctly then this probably makes every
> documented example of using ocf:pacemaker:ping with a colocation
> statement wrong because the only way to see the effect of dampen is
> to use a rule that references the value of pingd directly. That or
> the script for ping has a major flaw with respect to dampen.

Basically ping has 2 modes of operation, with and without
failure_score. Without failure_score, a rule must be used.

I only recall examples showing it without failure_score and with a rule

> That is when I do this:
> 
> pcs resource create myPing ocf:pacemaker:ping host_list=192.168.1.1
> failure_score=1
> pcs resource create database ocf:heartbeat:pgsql
> pcs group add pgrp myPing database
> 
> PCS will move everything to a new node if there is even 1 ping
> failure because monitor in ping doesn't look at the dampened value,
> only the value of the immediate returned value.

If you use failure_score.

If you don't use failure_score, then the ping monitor does not fail if
a ping fails. The ping monitor only sets a node attribute, which then
is used in a rule. With this setup, the ping resource should be cloned
on all nodes, and usually not involved in any group or constraints.

> The same is true with colocation statements - if a constraint is made
> with a ping resource without using a rule that references pingd then
>  the dampen behaviour is ignored completely.
> 
> Is the ping'er missing something that does this:
> 
> score=`cibadmin -Q -A "//nvpair[@name='ping']" | sed -e
> 's/.*value="\([^"]*\)".*/\1/'`
> 
> before it checks if $score is less than $OCF_RESKEY_failure_score?
> 
> Thanks

-- 
Ken Gaillot <kgaillot at redhat.com>



More information about the Users mailing list