HomeClusterLabs Projects

Fix: libpe_status: Make cluster_status() idempotent

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

Fix: libpe_status: Make cluster_status() idempotent

Previously, if cluster_status() were called twice without resetting the
scheduler between calls, most of the unpacked data would be duplicated
in the scheduler object's data structures. For example, the nodes in
scheduler->input would be stored twice in the scheduler's node list.

This changes the behavior of a public API function, but the previous
behavior resulted in incorrect status, so that seems acceptable.

This is not a perfect fix: scheduler->flags is publicly accessible, so a
caller could clear the pcmk__sched_have_status flag without resetting
the scheduler. That would not be wise to do, however, so we can ignore
that possibility for now and plan to deprecate cluster_status() later.

An alternative approach would be to explicitly free each scheduler data
structure before we unpack into it. Then cluster_status() could be
called multiple times with different inputs, getting the new status each
time. However, there is no internal use case for that, and it seems
prone to unforeseen corner cases.

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

Details

Provenance
nrwahl2Authored on Sat, Jan 25, 6:20 PM

Commit No Longer Exists

This commit no longer exists in the repository.