[ClusterLabs] ocf:pacemaker:ping works strange

Ken Gaillot kgaillot at redhat.com
Tue Dec 12 10:22:47 EST 2023


On Tue, 2023-12-12 at 18:08 +0300, Artem wrote:
> Hi Andrei. pingd==0 won't satisfy both statements. It would if I used
> GTE, but I used GT.
> pingd lt 1 --> [0]
> pingd gt 0 --> [1,2,3,...]

It's the "or defined pingd" part of the rule that will match pingd==0.
A value of 0 is defined.

I'm guessing you meant to use "pingd gt 0 *AND* pingd defined", but
then the defined part would become redundant since any value greater
than 0 is inherently defined. So, for that rule, you only need "pingd
gt 0".

> 
> On Tue, 12 Dec 2023 at 17:21, Andrei Borzenkov <arvidjaar at gmail.com>
> wrote:
> > On Tue, Dec 12, 2023 at 4:47 PM Artem <tyomikh at gmail.com> wrote:
> > >> > pcs constraint location FAKE3 rule score=0 pingd lt 1 or
> > not_defined pingd
> > >> > pcs constraint location FAKE3 rule score=125 pingd gt 0 or
> > defined pingd
> > > Are they really contradicting?
> > 
> > Yes. pingd == 0 will satisfy both rules. My use of "always" was
> > incorrect, it does not happen for all possible values of pingd, but
> > it
> > does happen for some.
> 
> May be defined/not_defined should be put in front of lt/gt ? It is
> possible that VM goes down, pingd to not_defined, then the rule
> evaluates "lt 1" first, catches an error and doesn't evaluate next
> part (after OR)?

No, the order of and/or clauses doesn't matter.
-- 
Ken Gaillot <kgaillot at redhat.com>



More information about the Users mailing list