mirror of https://github.com/apache/nifi.git
NIFI-4436: Fixed bug that caused a Process Group to be 'dirty' if a processor that was referencing a non-existent controller service is updated to reference an externally available controller service
Signed-off-by: Matt Gilman <matt.c.gilman@gmail.com>
This commit is contained in:
parent
b3e1584ef4
commit
f702f808a7
|
@ -240,7 +240,7 @@ public class StandardFlowSynchronizer implements FlowSynchronizer {
|
||||||
existingFlowEmpty = taskElements.isEmpty()
|
existingFlowEmpty = taskElements.isEmpty()
|
||||||
&& unrootedControllerServiceElements.isEmpty()
|
&& unrootedControllerServiceElements.isEmpty()
|
||||||
&& isEmpty(rootGroupDto)
|
&& isEmpty(rootGroupDto)
|
||||||
&& registriesPresent;
|
&& !registriesPresent;
|
||||||
logger.debug("Existing Flow Empty = {}", existingFlowEmpty);
|
logger.debug("Existing Flow Empty = {}", existingFlowEmpty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3316,7 +3316,17 @@ public final class StandardProcessGroup implements ProcessGroup {
|
||||||
ancestorServiceIds = Collections.emptySet();
|
ancestorServiceIds = Collections.emptySet();
|
||||||
} else {
|
} else {
|
||||||
ancestorServiceIds = parentGroup.getControllerServices(true).stream()
|
ancestorServiceIds = parentGroup.getControllerServices(true).stream()
|
||||||
.map(ControllerServiceNode::getIdentifier)
|
.map(cs -> {
|
||||||
|
// We want to map the Controller Service to its Versioned Component ID, if it has one.
|
||||||
|
// If it does not have one, we want to generate it in the same way that our Flow Mapper does
|
||||||
|
// because this allows us to find the Controller Service when doing a Flow Diff.
|
||||||
|
final Optional<String> versionedId = cs.getVersionedComponentId();
|
||||||
|
if (versionedId.isPresent()) {
|
||||||
|
return versionedId.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
return UUID.nameUUIDFromBytes(cs.getIdentifier().getBytes(StandardCharsets.UTF_8)).toString();
|
||||||
|
})
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3824,7 +3824,17 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
|
||||||
ancestorServiceIds = Collections.emptySet();
|
ancestorServiceIds = Collections.emptySet();
|
||||||
} else {
|
} else {
|
||||||
ancestorServiceIds = parentGroup.getControllerServices(true).stream()
|
ancestorServiceIds = parentGroup.getControllerServices(true).stream()
|
||||||
.map(ControllerServiceNode::getIdentifier)
|
.map(cs -> {
|
||||||
|
// We want to map the Controller Service to its Versioned Component ID, if it has one.
|
||||||
|
// If it does not have one, we want to generate it in the same way that our Flow Mapper does
|
||||||
|
// because this allows us to find the Controller Service when doing a Flow Diff.
|
||||||
|
final Optional<String> versionedId = cs.getVersionedComponentId();
|
||||||
|
if (versionedId.isPresent()) {
|
||||||
|
return versionedId.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
return UUID.nameUUIDFromBytes(cs.getIdentifier().getBytes(StandardCharsets.UTF_8)).toString();
|
||||||
|
})
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue