HomeClusterLabs Projects

Refactor: libcrmcommon: pcmk__xe_remove_matching_attrs() new force arg
ebe0e02fab47Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.
This commit no longer exists in the repository. It may have been part of a branch which was deleted.This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.

Description

Refactor: libcrmcommon: pcmk__xe_remove_matching_attrs() new force arg

This isn't necessary, but it's convenient. The force argument passes
through to pcmkxa_remove(), which pcmkxe_remove_matching_attrs()
calls.

The motivation is xml_accept_changes(). Previously, we checked the
document's pcmkxf_dirty flag, cleared all the document's flags, and
then accepted attr deletions throughout the tree. There was a hidden
ordering dependency there. If we did not clear the document's flags
before accepting the tree's attr deletions, then the document's
pcmk
xf_tracking flag would still be enabled. In that case,
pcmkxa_remove() wouldn't actually remove the deleted attributes. It
would just set their pcmk
xf_deleted flag... which was already set.

Now, we check the doc's flag, accept attr deletions throughout the tree
if set, and then clear everything in the doc that needs to be cleared.

On the flip side, adding another argument is mildly inconvenient for
other callers. Oh well.

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

Details

Provenance
nrwahl2Authored on Mar 13 2025, 1:44 PM

Event Timeline

Commit No Longer Exists

This commit no longer exists in the repository.