Gabriel Orstadius-Bui created NIFI-16555:
--------------------------------------------
Summary: FlowDifferenceFilters: retried/auto-terminated
relationship changes from splitRelationship() reported as local changes
Key: NIFI-16555
URL: https://issues.apache.org/jira/browse/NIFI-16555
Project: Apache NiFi
Issue Type: Bug
Components: Core Framework
Affects Versions: 2.12.0
Reporter: Gabriel Orstadius-Bui
NIFI-15011 updated FlowDifferenceFilters so that connection changes caused by
RelationshipConfiguration.splitRelationship() are treated as environmental. It
did this with isSelectedRelationshipChangeForNewRelationship. However, the
split also changes the processor's retried and auto-terminated relationships,
and those differences are not filtered. As a result, a versioned process group
shows local changes right after a NAR upgrade, even though the user changed
nothing.
Steps to reproduce:
# In a versioned process group, configure a processor whose e.g. failure
relationship is set to Retry. Commit the flow to the registry.
# Upgrade to a NAR version where the processor's migrateRelationships calls
config.splitRelationship(e.g. "failure", "failure", "retry", "no retry").
# Restart or reload the flow.
# Expected: The process group remains "Up to date", the same as when failure
is only connected.
Actual: The process group shows "Locally modified" with a
RETRIED_RELATIONSHIPS_CHANGED difference: [failure] → [failure, retry, no
retry].
Root cause
StandardRelationshipConfiguration.replaceRelationship copies the old
relationship's retry setting to the new relationships. It does the same for the
auto-terminate setting.
StandardFlowComparator compares getRetriedRelationships() and
getAutoTerminatedRelationships() using set equality, so it reports a difference.
In FlowDifferenceFilters.isEnvironmentalChange, the only check that applies is
isNewRetryConfigWithDefaultValue. That check returns false as soon as the
snapshot value is non-null.
isNewRelationshipAutoTerminatedAndDefaulted only filters a relationship whose
default is auto-terminate (Relationship.isAutoTerminated()). Most new
relationships do not have that default.
I expect the same thing to happen with AUTO_TERMINATED_RELATIONSHIPS_CHANGED
when failure was auto-terminated, but I haven't reproduced that case.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)