HomeClusterLabs Projects

Refactor: scheduler: avoid unnecessary probe loop for anonymous clones

Description

Refactor: scheduler: avoid unnecessary probe loop for anonymous clones

For anonymous clones, clone_create_probe() first uses find_instance_on() to
check for any clone instance (or any of its children, for cloned groups) already
known on a node. Only if none is found does is look for an instance allocated
to the node, or as a fallback, use the first clone instance.

In any case, by the time native_create_probe() is called for a clone instance,
we are already sure that no other clone instance is known on this node.
Therefore, we do not need to re-check all other clone instances.

As a side effect, this resolves two bugs in the removed code. First,
probe_anon_group_member() needlessly searched all of data_set->resources
when checking for other clone instances, when rsc->children was the right
space. Second, an increment_clone() bug introduced in 2.0.0 via commit 6caa3a64
returned rscname:0:10 when given rscname:9. The effect was to short-circuit the
check for other instances, which ironically was beneficial.

Details

Provenance
kgaillotAuthored on Jul 12 2018, 11:01 AM
Parents
rPcb51d1c000d3: Refactor: scheduler: improve efficiency of checking for clone instance on node
Branches
Unknown
Tags
Unknown

Event Timeline