Hsin-Ying Lee created NIFI-8116:
-----------------------------------
Summary: The old peers do not be deleted when the URIs of the
remote process group are changed
Key: NIFI-8116
URL: https://issues.apache.org/jira/browse/NIFI-8116
Project: Apache NiFi
Issue Type: Bug
Components: Core Framework
Affects Versions: 1.12.1, 1.12.0
Reporter: Hsin-Ying Lee
When we start transmitting for RPG, Peer Persistence will restore the peers
retrieved from disk. It only checks whether the protocol has changed but it
doesn't check the URIs.
Due to the refactoring of NIFI-7467, peerStatusCache and
getLastFetchedQueryablePeers() refer to the same object.
We need to add a condition to check whether the URIs have been changed and
discard the previous peer restored from the disk, or we will see RPG attempts
to transmit data to both old and new NiFi instance and cause the errors
Steps to Reproduce,
# create a RPG and set the URIs to nifi instance A
# transfer a flowfile (enforce the Peer Persistence to store the peers to disk)
# stop transmit and change the URIs to another instance B
# transfer flowfiles again
{code:java}
2021-01-05 05:41:47,854 ERROR [Timer-Driven Process Thread-9]
o.a.nifi.remote.StandardRemoteGroupPort RemoteGroupPort[name=data
in,targets=https://nifi-cluster-a:8443/nifi] failed to communicate with
https://nifi-cluster-a:8443/nifi because the remote instance indicates that the
port no longer exists
2021-01-05 05:41:47,855 ERROR [Timer-Driven Process Thread-9]
o.a.nifi.remote.StandardRemoteGroupPort RemoteGroupPort[name=data
in,targets=https://nifi-cluster-a:8443/nifi] Failed to process session due to
org.apache.nifi.processor.exception.ProcessException:
org.apache.nifi.remote.exception.UnknownPortException:
Peer[url=nifi://nifi-cluster-b:10433,CLOSED] indicates that port
d106c7cb-0176-1000-0000-000072ce6099 is not known:
org.apache.nifi.processor.exception.ProcessException:
org.apache.nifi.remote.exception.UnknownPortException:
Peer[url=nifi://nifi-cluster-b:10433,CLOSED] indicates that port
d106c7cb-0176-1000-0000-000072ce6099 is not known
org.apache.nifi.processor.exception.ProcessException:
org.apache.nifi.remote.exception.UnknownPortException:
Peer[url=nifi://nifi-cluster-b:10433,CLOSED] indicates that port
d106c7cb-0176-1000-0000-000072ce6099 is not known
at
org.apache.nifi.remote.StandardRemoteGroupPort.onTrigger(StandardRemoteGroupPort.java:237)
at
org.apache.nifi.controller.AbstractPort.onTrigger(AbstractPort.java:244)
at
org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:214)
at
org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.nifi.remote.exception.UnknownPortException:
Peer[url=nifi://nifi-cluster-b:10433,CLOSED] indicates that port
d106c7cb-0176-1000-0000-000072ce6099 is not known
at
org.apache.nifi.remote.client.socket.EndpointConnectionPool.getEndpointConnection(EndpointConnectionPool.java:258)
at
org.apache.nifi.remote.client.socket.SocketClient.createTransaction(SocketClient.java:127)
at
org.apache.nifi.remote.StandardRemoteGroupPort.onTrigger(StandardRemoteGroupPort.java:223)
... 11 common frames omitted
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)