[
https://issues.apache.org/jira/browse/NIFI-16085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18094657#comment-18094657
]
ASF subversion and git services commented on NIFI-16085:
--------------------------------------------------------
Commit 6e7b31fa194280512a3866fc83c3d97ad74ba692 in nifi's branch
refs/heads/main from Pierre Villard
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=6e7b31fa194 ]
NIFI-16085 - Flow synchronization fails when a Parameter Provider-backed
Parameter Context contains a parameter not flagged as provided (#11403)
Signed-off-by: Kevin Doran <[email protected]>
> Flow synchronization fails when a Parameter Provider-backed Parameter Context
> contains a parameter not flagged as provided
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: NIFI-16085
> URL: https://issues.apache.org/jira/browse/NIFI-16085
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Reporter: Pierre Villard
> Assignee: Pierre Villard
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> When NiFi synchronizes a flow (a node joining/rejoining a cluster, or loading
> the flow at startup) VersionedFlowSynchronizer rebuilds each Parameter
> Context's parameters from the serialized flow and copies the per-parameter
> provided flag verbatim (VersionedParameter.isProvided()). If a Parameter
> Context that is backed by a Parameter Provider contains a parameter whose
> serialized provided flag is false, the synchronizer calls
> ParameterContext.setParameters(...) with a user-entered parameter, which
> StandardParameterContext rejects:
> {code:java}
> java.lang.IllegalArgumentException: Parameters for Context [<name>] cannot be
> manually updated
> because they are provided by Parameter Provider [<id>]{code}
> wrapped as:
> {code:java}
> org.apache.nifi.controller.serialization.FlowSynchronizationException: Failed
> to connect node to cluster
> because local flow controller partially updated. Administrator should
> disconnect node and review flow for corruption. {code}
> The node then fails to start the Flow Service and, in a cluster, disconnects
> with Disconnect Code "Node's Flow did not Match Cluster Flow" and cannot
> rejoin. The node stays down until the flow is manually corrected.
> Why the state is reachable: a provider-backed Parameter Context can never
> hold a non-provided (user-entered) parameter as a live object, it is rejected
> at every write path (setParameters, and binding a Provider onto a context
> that already has user-entered parameters). However,
> VersionedParameter.provided is a primitive boolean that defaults to false on
> deserialization, so a serialized flow can present a provider-backed context
> with a provided=false parameter (e.g. across serialization/version
> differences). Flow synchronization trusts that per-parameter flag instead of
> the context-level Provider binding.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)