HomeClusterLabs Projects

Refactor: libpe_status, libpacemaker: node_list_exclude() best practices

Description

Refactor: libpe_status, libpacemaker: node_list_exclude() best practices

This is only used with colocations, for excluding nodes from a
dependent's allowed nodes table that are not in a list of suitable nodes
where the primary will run.

Rename to pcmk__colocation_intersect_nodes(), move to libpacemaker,
accept primary and colocation as arguments for logging, rename variables
for clarity, add doxygen, improve error checking.

Also drop the block where we inserted a new node into the allowed nodes
table with score -INFINITY if a node was found in the primary nodes list
but not the dependent's allowed nodes table. New nodes don't get
inserted after location constraints have been processed, so we don't
need to explicitly ban the dependent from a node proactively if the node
isn't in its table.

We might be able to improve things further by functionizing the logic
that builds the primary_nodes list in the three callers. For right now,
there are enough differences that I don't want to deal with it.

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

Details

Provenance
nrwahl2Authored on Jul 2 2023, 1:00 AM
Parents
rP4c7c59b504c6: Refactor: libpe_status, libpacemaker: Drop pe_hash_table_lookup()
Branches
Unknown
Tags
Unknown