HomeClusterLabs Projects

Low: scheduler: order clone instances properly

Description

Low: scheduler: order clone instances properly

A clone with the "ordered" meta-attribute set to true will have its instances
started and stopped sequentially rather than in parallel.

These instance orderings were being set in both pcmkclone_create_actions()
and pcmk
clone_internal_constraints().

pcmk__create_internal_constraints() handled the simple case of all instances
starting or stopping, by ordering each instance relative to the previous or
next instance.

pcmk__clone_create_actions() added more orderings because only some instances
might be starting or stopping (for example, instance 1 would need to be ordered
before instance 3 if those but not instance 2 were starting).

However, this was confusingly redundant, and pcmk__clone_create_actions() only
ordered actions if there was exactly one required start / stop. This was a
problem because actions could be flipped between optional and required later in
the scheduler sequence, and also because there could legitimately be multiple
stops of a single instance of a unique clone if it were multiply active.

Now, the ordering is done only in pcmk__clone_internal_constraints(), but each
instance is ordered relative to *every* later instance.

Details

Provenance
kgaillotAuthored on Apr 11 2023, 10:49 AM
Parents
rP8d6b508c0d57: Refactor: scheduler: best practices for clone_internal_constraints()
Branches
Unknown
Tags
Unknown