HomeClusterLabs Projects

Fix: scheduler: properly sort rule-based blocks when overwriting values

Description

Fix: scheduler: properly sort rule-based blocks when overwriting values

Previously, sorting nvpair blocks for rule processing using sort_pairs() always
sorted with the highest score first.

This makes sense when evaluating nvpairs with overwrite set to false, so the
highest score takes precedence. However, when overwrite is true, this wrongly
makes the lowest score take precedence.

Now, the sort order depends on overwrite.

This has gone undetected for so long because nearly all callers set overwrite
to false. The main exception is when unpacking action meta-attributes.

Details

Provenance
kgaillotAuthored on Aug 10 2023, 6:20 PM
Parents
rP43146f7b2d6e: Fix: scheduler: properly evaluate rules in action meta-attributes
Branches
Unknown
Tags
Unknown