HomeClusterLabs Projects

Low: scheduler: improve migration code in native_create_actions()

Description

Low: scheduler: improve migration code in native_create_actions()

This may be difficult to follow, but is nearly equivalent to the previous code.

The setting of is_moving is moved to the start of the function. Migration is
possible only if the resource is moving, so allow_migrate is now set with it,
and some of the tests that would later set allow_migrate to false are moved
here as well.

Those tests functionally overlapped some of the tests for a continuable partial
migration, so allow_migrate is now used there instead.

When a partial migration can't be continued, that now has improved logs, and
rather than unset multiply_active, it simply is done first so multiple_active
doesn't get set, and the clearing of partial migration data is done here, so
it's closer to the test for it, and the multiply_active block can be
simplified.

Besides the logs, the effective differences are tiny, mainly being more careful
about checking current, chosen, partial_migration_source, and
partial_migration_target for any combination of NULL.

No regression tests change ...

Details

Provenance
kgaillotAuthored on Jun 13 2022, 3:45 PM
Parents
rP349fb311e0c9: Refactor: scheduler: functionize aborting a dangling migration
Branches
Unknown
Tags
Unknown