HomeClusterLabs Projects

Refactor: scheduler: add function for checking general node health

Description

Refactor: scheduler: add function for checking general node health

In contrast to pesum_node_health_scores() which calculates a cumulative score
of all health attributes, the new function pe
node_health() takes the node's
general temperature (red/yellow/green).

It checks whether at least one health attribute is yellow or red, which is a
more intuitive way of saying the node's health is yellow or red (otherwise
multiple yellow health attributes added together could make a node's health
status red).

I went with a comparison-like return value (-1 for red, 0 for yellow, +1 for
green).

I didn't go with pcmkscore_red etc. as the return value because it's possible
that some of those values are equal, and for these purposes we want to be able
to distinguish them. For example, pcmk
score_green and pcmk__score_yellow
might both be 0, but if a health attribute has the textual value "yellow" we
want to return yellow instead of green.

Another possibility would be to add pcmk_rc_red etc. and return those, but that
seemed overkill for this one function.

Details

Provenance
kgaillotAuthored on Apr 1 2022, 12:36 PM
Parents
rPbb1d1aba3a9c: Refactor: scheduler: functionize calculating overall node health
Branches
Unknown
Tags
Unknown