[
https://issues.apache.org/jira/browse/NIFI-12394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17796772#comment-17796772
]
Mark Payne commented on NIFI-12394:
-----------------------------------
Thanks for reporting, [~mosermw] . That's a good corner case that I'd not
thought of.
So when a Processor (or Controller Service or Reporting Task) is created in the
StandardVersionedComponentSynchronizer, we add a {{CreatedExtension}} to the
{{createdExtensions}} Map. When the entry is added, it has the original
property values.
We then call {{updateProcessor}} which calls {{{}populatePropertiesMap{}}}.
This is the part of the code where, if a Property references a Controller
Service, it updates the Properties Map.
Then, at the end, we call {{migrateConfiguration}} which is responsible for
updating the properties, based on the original property values.
So the solution that I would propose would be in {{{}populatePropertiesMap{}}},
we update the logic there so that if it maps a property value to a Controller
Service, we also get the {{CreatedExtension}} from the Map and update the
property map there too. I believe this should then pass in the values to
{{migrateConfiguration}} (which then calls {{{}migrateProperties{}}}) with the
appropriate value.
> when importing versioned flow with component that migrates properties,
> controller service reference is invalid
> --------------------------------------------------------------------------------------------------------------
>
> Key: NIFI-12394
> URL: https://issues.apache.org/jira/browse/NIFI-12394
> Project: Apache NiFi
> Issue Type: Bug
> Components: Flow Versioning
> Reporter: Michael W Moser
> Priority: Major
>
> I built a Process Group containing one StandardRestrictedSSLContextService
> that is referenced by one InvokeHTTP processor. I downloaded that Process
> Group as a flow definition {*}with external services{*}. I also versioned
> that Process Group in NiFi Registry.
> Inside the flow definition file, I see the
> StandardRestrictedSSLContextService with
> "identifier":"d7d70b6c-abe4-3564-a219-b289cb7f25d2" and InvokeHTTP references
> that UUID.
> When I create a new Process Group using either the downloaded flow definition
> or the NiFi Registry flow, a new StandardRestrictedSSLContextService is
> created and it has a new UUID as expected. The InvokeHTTP processor is
> invalid because it references the proposed
> StandardRestrictedSSLContextService UUID d7d70b6c-abe4-3564-a219-b289cb7f25d2
> which does not exist.
> The service and processor are created and references are updated, but when
> migrating processor properties and any change occurs, the service reference
> is reverted back to what was in proposedProperties.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)