Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly handle xml comments #1225

Merged
merged 2 commits into from Feb 13, 2017
Merged

Conversation

gao-yan
Copy link
Member

@gao-yan gao-yan commented Feb 13, 2017

No description provided.

…m 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.
…ositions

Previously, v2 patchset was not able to define which exact XML comments were
expected to be deleted in a CIB XML element. It was a problem if there
was more than one comment at the same level within a CIB XML element.

This commit resolves it by adding and handling a "position" field in the
diff operation "delete" for XML comments.
@kgaillot
Copy link
Contributor

Wow, that's a long run for a short slide ;-)

@kgaillot kgaillot merged commit ea6fb27 into ClusterLabs:master Feb 13, 2017
@gao-yan
Copy link
Member Author

gao-yan commented Feb 13, 2017

;-) Well, I'm quite surprised that some users really like to comment in their cib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants