[ 
https://issues.apache.org/jira/browse/NIFI-7489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Secules updated NIFI-7489:
-------------------------------
    Description: 
h1. Description

When I download versioned flows from NiFi Registry, sometimes it does not 
connect processors to controller services even though one exists in scope and 
it has the same name as the one it was originally connected to.
h1. Expected Behaviour

NiFi downloads versioned process groups and connects external controller 
services correctly provided that a compatible controller service is available 
and has the same name.
h1. Actual Behaviour

NiFi downloads versioned flows but does not connect all external controller 
services.
h1. Steps to reproduce:
 * Upload the attached template to your NiFi
 * Ensure the necessary Controller Services exist at the ROOT process group.
 ** DistributedMapCacheClientService
 ** AzureStorageCredentialsControllerService
 ** DistributedMapCacheServer
 * Resolve all warnings on processors, maybe need to connect the above 
controller services.
 * Start version control on "Inner Versioned Flow"
 * Start version control on "Outer Versioned Flow"
 * Clear Canvas
 * Delete and Recreate the Controller Services
 ** DistributedMapCacheClientService
 ** AzureStorageCredentialsControllerService
 ** DistributedMapCacheServer
 * Import "Outer Versioned Flow" from your registry

You should observe that one processor in Inner Versioned Flow is invalid 
because it wasn't connected to an existing controller service and that the 
other processor is valid because by coincidence it shares the same dependency 
on an external controller service as the Outer Versioned Flow

h1. Notes
I believe the issue is that the code falls into [this line 
here|https://github.com/apache/nifi/blob/45e626f6a872296cdd08fcfc533c7ce7e3624fca/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java#L3585]
 because the `externalControllerServiceReferences` is always set to that of the 
outermost versioned process group being imported even if the current process 
group being imported is versioned as well and has a different set of 
`externalControllerServiceReferences`

A solution may be to make sure that `externalControllerServiceReferences` 
corresponds to the innermost versioned process group being imported. 

Another potential solution could be to make sure that outer versioned process 
groups' `externalControllerServiceReferences` is a superset of all the 
`externalControllerServiceReferences` from versioned process groups inside it.

A good restriction to have might be not to allow Controller Services with the 
same name to exist in the same scope. 

  was:
h1. Description

When I download versioned flows from NiFi Registry, sometimes it does not 
connect processors to controller services even though one exists in scope and 
it has the same name as the one it was originally connected to.
h1. Expected Behaviour

NiFi downloads versioned process groups and connects external controller 
services correctly provided that a compatible controller service is available 
and has the same name.
h1. Actual Behaviour

NiFi downloads versioned flows but does not connect all external controller 
services.
h1. Steps to reproduce:
 * Upload the attached template to your NiFi
 * Ensure the necessary Controller Services exist at the ROOT process group.
 ** DistributedMapCacheClientService
 ** AzureStorageCredentialsControllerService
 ** DistributedMapCacheServer
 * Resolve all warnings on processors, maybe need to connect the above 
controller services.
 * Start version control on "Inner Versioned Flow"
 * Start version control on "Outer Versioned Flow"
 * Clear Canvas
 * Delete and Recreate the Controller Services
 ** DistributedMapCacheClientService
 ** AzureStorageCredentialsControllerService
 ** DistributedMapCacheServer
 * Import "Outer Versioned Flow" from your registry

You should observe that one processor in Inner Versioned Flow is invalid 
because it wasn't connected to an existing controller service and that the 
other processor is valid because by coincidence it shares the same dependency 
on an external controller service as the Outer Versioned Flow


> resolveInheritedControllerServices doesn't connect all controller services
> --------------------------------------------------------------------------
>
>                 Key: NIFI-7489
>                 URL: https://issues.apache.org/jira/browse/NIFI-7489
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework, Flow Versioning
>    Affects Versions: 1.11.4
>         Environment: Official NiFi Docker Container
>            Reporter: Eric Secules
>            Priority: Major
>         Attachments: externalServiceReference_Issue.xml
>
>
> h1. Description
> When I download versioned flows from NiFi Registry, sometimes it does not 
> connect processors to controller services even though one exists in scope and 
> it has the same name as the one it was originally connected to.
> h1. Expected Behaviour
> NiFi downloads versioned process groups and connects external controller 
> services correctly provided that a compatible controller service is available 
> and has the same name.
> h1. Actual Behaviour
> NiFi downloads versioned flows but does not connect all external controller 
> services.
> h1. Steps to reproduce:
>  * Upload the attached template to your NiFi
>  * Ensure the necessary Controller Services exist at the ROOT process group.
>  ** DistributedMapCacheClientService
>  ** AzureStorageCredentialsControllerService
>  ** DistributedMapCacheServer
>  * Resolve all warnings on processors, maybe need to connect the above 
> controller services.
>  * Start version control on "Inner Versioned Flow"
>  * Start version control on "Outer Versioned Flow"
>  * Clear Canvas
>  * Delete and Recreate the Controller Services
>  ** DistributedMapCacheClientService
>  ** AzureStorageCredentialsControllerService
>  ** DistributedMapCacheServer
>  * Import "Outer Versioned Flow" from your registry
> You should observe that one processor in Inner Versioned Flow is invalid 
> because it wasn't connected to an existing controller service and that the 
> other processor is valid because by coincidence it shares the same dependency 
> on an external controller service as the Outer Versioned Flow
> h1. Notes
> I believe the issue is that the code falls into [this line 
> here|https://github.com/apache/nifi/blob/45e626f6a872296cdd08fcfc533c7ce7e3624fca/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java#L3585]
>  because the `externalControllerServiceReferences` is always set to that of 
> the outermost versioned process group being imported even if the current 
> process group being imported is versioned as well and has a different set of 
> `externalControllerServiceReferences`
> A solution may be to make sure that `externalControllerServiceReferences` 
> corresponds to the innermost versioned process group being imported. 
> Another potential solution could be to make sure that outer versioned process 
> groups' `externalControllerServiceReferences` is a superset of all the 
> `externalControllerServiceReferences` from versioned process groups inside it.
> A good restriction to have might be not to allow Controller Services with the 
> same name to exist in the same scope. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to