nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brandon DeVries (JIRA)" <>
Subject [jira] [Created] (NIFI-2159) Fingerprint not detecting flow.xml differences
Date Fri, 01 Jul 2016 12:15:11 GMT
Brandon DeVries created NIFI-2159:

             Summary: Fingerprint not detecting flow.xml differences
                 Key: NIFI-2159
             Project: Apache NiFi
          Issue Type: Bug
    Affects Versions: 0.6.1
            Reporter: Brandon DeVries
            Priority: Critical
             Fix For: 0.7.0

We have very occasionally observed situations where the flow.xml across a cluster was able
to become inconsistent, resulting in unexpected behavior.  While investigating, the following
issue was found.  While we are not 100% that this problem is the one we were looking for,
it is definitely an issue...

Within the FingerprintFactory, the text values from <relationship> tags were always
being appended to the fingerprint as a default value of "NO_VALUE" regardless of whether or
not they actually contained a value.  This can manifest as two different flow.xml files being
considered the same when they have the same number of relationship tags, even though those
tags contain different values.  Here is a suggested fix:

Change the following in\[1\]:

final List<Element> sortedRelationshipElems = sortElements(relationshipElems, getConnectionRelationshipsComparator());
for (final Element relationshipElem : sortedRelationshipElems) {
        addConnectionRelationshipFingerprint(builder, relationshipElem);


for (int i = 0;i<relationshipElems.getLength();i++) {

The following unit test will show that the value of the relationship is now being used in
the fingerprint:

public void testResourceValueInFingerprint() throws IOException{
       final String fp1 = fingerprinter.createFingerprint(getResourceBytes("/nifi/fingerprint/flow1a.xml"),null);

Additionally, the <name> tag isn't being included in the fingerprint either.  While
the following solution has not been tested, it is possible that this could be fixed by adding
the following line to the addConnectionFingerprint() method \[2\]:

appendFirstValue(builder, DomUtils.getChildNodesByTagName(connectionElem, "name"));


This message was sent by Atlassian JIRA

View raw message