HomeClusterLabs Projects

Fix: libcrmcommon: Correctly compare XML comments to prevent crmd from getting…

Description

Fix: libcrmcommon: Correctly compare XML comments to prevent crmd from getting into infinite election loop

With b7fa323, crmd could still get into an infinite election loop when
there was more than one comment with the exactly same text at the same
level within a CIB XML element. For example:

'''

<!--# "Fri Feb 10 11:20:40 CET 2017-->
<!--#============================================================================-->
<!--#-->
<!--# Administrator A-->
<!--#-->
<!--# Pacemaker basic config file for Cluster A-->
<!--#============================================================================-->
<!--#-->

'''

Basically, it'd produce big messes if using the diff operation "move"
for XML comments in such a case.

With this commit, it strictly tries to match the XML comments at the
exactly same offsets when comparing v2 patchset, so that only the diff
operations "create" and "delete" will be used for XML comments.

Details

Provenance
gao-yanAuthored on Feb 10 2017, 9:44 AM
Parents
rPfdb53ab9574f: Merge pull request #1222 from kgaillot/fixes
Branches
Unknown
Tags
Unknown

Event Timeline