HomeClusterLabs Projects

Fix: libcib: Don't overwrite property values for CIB config hash

Description

Fix: libcib: Don't overwrite property values for CIB config hash

This is a regression introduced by commit 324e241d. However, it makes a
difference only when there are multiple properties with the same name in
the same cluster_property_set. This is allowed, but there's no valid use
case for it.

Currently, the value of the last property with a given name in a given
cluster_property_set, or in a group of cluster_property_sets with equal
scores, is applied. With this commit, the first one is applied instead.

The reasoning in the commit message for 324e241d seems to be mistaken:
the call to g_hash_table_remove_all() before pe_unpack_nvpairs() ensures
that the options table is empty, so there is nothing to overwrite.
sort_pairs() ensures that the cluster_property_sets that we're about to
process are processed in the correct order based on scores.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Jul 9 2024, 2:38 PM
Parents
rP5063f054e1b8: Refactor: libcrmcommon: Staticize pcmk__xml_update()
Branches
Unknown
Tags
Unknown